[EMAIL PROTECTED] wrote:

Hi,

I cannot imagine I'm the first to stumble onto this so I hope some of you
have a solution to this problem:

How can I refer to an "absolute" path, but relative to the root directory of
my webapplication, both in the sitemap and in any content file.

Situation:
/tomcat/webapps/cocoon/myWebApp

Screen consists of tables, one of them contains the menu. How can I make
sure that the links in the menu always start relative to the root of
myWebApp? E.g. Link1 = /subdir1/somepage.html
Link2 = /subdir2/someOtherPage.html


I've tried "/subdir1/somepage.html", but this is turned into localhost:8080/subdir1/somepage.html

This is trickier than it sounds. The request contains the information you need: getSitemapURI() gives the sitemap part and getServletPath() the path your application (cocoon) is mounted in the servlet. Combine both and there you are.


To access this information, you could either use XSP (request logicsheet, input logicsheet) or pass the information from the sitemap to a sitemap component and obtain it with the request input module "{request:servletPath}/{request:sitemapURI}".

You could use XSLT to add this to all URIs, or you could use the LinkRewritingTransformer for this.

HTH
        Chris.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to