Show TOC

Creating URLs to Web ResourcesLocate this document in the navigation structure

Procedure

This section explains how to create links to Web resources contained in your portal application. Web resources are the files in your application that can be accessed directly via an HTTP request.

The following code retrieves the URL to the XML file BugsReminder.xml and outputs it to the response:

            IResource myResource = 
                 request.getResource(IResource.XML,"xml/BugsReminder.xml");
            response.write(myResource.getResourceInformation().getURL(request));
         
Note

Never hardcode URLs. Always use the API to create the URLs.