Skip to Content
Former Member
Jul 03, 2007 at 10:48 AM

URLGeneratorService - Hostname not resolved


We are developing a Portal Page that contains file attachments. These attachments are stored on the KM directory and will be displayed as hyperlinks on the portal page. I am using the following code to get the URL of the files in order to display them as hyper links.

IURLGeneratorService ug = (IURLGeneratorService)ResourceFactory.getInstance().getServiceFactory().getService("URLGeneratorService");

UriReference uriRef = ug.getResourcePageUri(PathKey.CONTENT_ACCESS_PATH, res.getRID(), null);

IHierarchicalUri uri = ug.createAbsoluteUri(uriRef);

String uriString = uri.toExternalForm();

After execution, uriString contains the value


The value of the hostname is not resolved and so the link doesnt work. But if I hardcode the url in the program then the link works.

Please help on how to resolve the <%hostname%>.