Skip to main content link. Accesskey S

XPages Wiki

Submit Search

YouAtNotes XPages Wiki


Home > UI > Work with URLs

Work with URLs

ShowTable of Contents
Here is a list of useful URLs for XPages and Domino web development.

XPages URLs


$$OpenDominoDocument.xsp?id=<UNID>

Opens the document with the given UNID. Tries to find a suitable XPage for opening by using these rules:

- Check if the document's form has the "open in XPage property"
- Check if there is a XPage with the same name as the document#s form

xpage.xsp?documentId=<UNID>&action=openDocument

Opens the given XPage with the document given by <UNID> in read mode.

xpage.xsp?documentId=<UNID>&action=editDocument

Opens the given XPage with the document given by <UNID> in edit mode.

Domino URLs


The Domino Wiki has a full list of URLs: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/07302008084503AMKMKGXS.htm

Accessing the history of URLs


You find a history of opened URLs in your XPages app in context.getHistoryUrl(level).

Redirecting to an URL


facesContext.getExternalContext().redirect("http://www.somehost.com")


Note: the URL needs to be complete with http:// and hostname.

Get path or URL of current request


Current path:

facesContext.getExternalContext().getRequest().getContextPath()


Full path inclusive page name:

facesContext.getExternalContext().getRequest().getRequestURI()


Full URL:

facesContext.getExternalContext().getRequest().getRequestURL()


Decode an URL


resultstring=java.net.URLDecoder.decode(urlstring,"UTF-8");

Get an URL parameter


Normally you can use

context.getUrlParameter("parameter")


But this does not work with your parameter is named "id" or you use some other reserved word.
In that case you can use:

q = facesContext.getExternalContext().getRequest().getQueryString();
k = "id";
if (q.indexOf(k+"=")>-1) {
    v = q.substring(q.indexOf(k+"=")+k.length()+1, q.length());
    v = (v.indexOf("&")>-1?v.substring(0,v.indexOf("&")):v);
} 

Referencing the domino html directory


In some places you can only use relative URLs, for example when defining the URL to an image resource. Nevertheless you can access the /data/domino/html directory using the following string:

/.ibmxspres/domino/


Note the missing "html" part.
For example, to refence an image saved in /data/domino/html/myimages/test.jpg you can write:

/.ibmxspres/domino/myimages/test.jpg


(Found by Paul Withers)

Special attachment URLs


See Blog entry at Stephan Wissel's Site
See what's possible with Xpages.
Have a look at our ServiceCommunicator website
and the YouAtNotes Support.
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this wiki help you?
Did this saved you time? Express your gratitude by making a donation:
PayPal - The safer, easier way to pay online!