This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 21, 2013, 1:29 AM
110 Posts

Get http URL while in Notes Client

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags:
  • Replies: 1

How do I get the http URL while inside the Notes Client? Referring to the XPages URL Cheat Sheet, the code is:

var url:XSPUrl = new XSPUrl(database.getHttpURL());

var result = url.getHost();

return result;

I put the above code in a computed field but it only worked in web browser. In my Notes Client it'll be empty.

For now my only workaround is to hard-code into applicationScope like this : applicationScope.httpurl = "www.mysite.com.my"

Jul 12, 2013, 1:28 AM
15 Posts
Some options...

The Domino Directory (names.nsf) has a server document for every server.
If you're looking at a server document in the Notes client, you should see a "fully qualified internet host name" under the Basics tab, and "host names(s)" under the Internet Protocols->HTTP tab.
You can get the value of one of those fields by a lookup on the server name in server-side javascript.

However, those host names might not be what you want. You might prefer to use another domain for the same server that doesn't match the host names in the server document.
In that case, you could make a configuration document with a custom form in your xpage database, mapping server names to the preferred domain names.
Then you'd be performing a lookup on the server name in your own database, which should be slightly faster than looking up the Domino Directory.

Once you have a domain name, you can just use database.getFilePath() to make the rest of the URL, but if your Notes client runs on Windows you'll need to replace backslashes with forward slashes.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal