This follows on from two previous articles where I outlined what became evident from the oneui themes, ways to reference server-based resources from XPages. Those articles (Part One and Part Two) concentrated on images, the most useful resource.

Like many developers, at Intec we have a suite of databases with resources (some images, css files, script libraries etc) residing in a single database. When referencing resources, if you prefix the database path with “/” the output HTML is prefixed with the current database path as well. This resulted in me using SSJS to get the full host name and protocol (“http” or “https”), not a pretty or good-practice way of doing it.

Today, when challenged by one of my colleagues, I finally put two and two together and realised that by using “/.ibmxspres/domino” I get to the data folder, from which I can navigate to sub-folders. (At times I can be rather slow!) So instead of referencing the protocol and host name, I can use “/.ibmxspres/domino/” + the database path to reference another database on the same server.

1 thought on “XPages: Accessing Server-Based Resources – External Database”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.