From: "Gary Larsen" <[EMAIL PROTECTED]>
Date: Sun, 8 Apr 2007 07:35:10 -0400
Hi,
Is it possible to determine the url of the Cocoon servlet container or even
the Cocoon servlet itself?
I see that the StatusGenerator can determine the host name, but need
something like http://hostname:port or http://hostname:port/appname
I want to deliver data to external applications. Being able to display the
URL that a user should paste in their application would be helpful.
You could use the request input module
(http://cocoon.apache.org/2.1/userdocs/concepts/modules-ref.html#RequestModule)
in your sitemap to determine the context path, and pass that in to the XSL
that's generating your page. Something like
<map:transform src="mypage.xsl">
<map:parameter name="contextroot" value="{request:contextPath}/>
</map:transform>
in the Cocoon pipeline and
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="contextroot" select="'/defaultcontext'"/>
...
<xsl:template match="mylink">
<a href="{$contextroot}/restofurl"/>
in your XSL. If you need other parts of the requested URL, you can use the
other HttpServletRequest methods in the same way.
Hope this helps,
Andrew.
--
http://pseudoq.sourceforge.net/ Open source java Sudoku designer & solver
_________________________________________________________________
Mortgage refinance is Hot. *Terms. Get a 5.375%* fix rate. Check savings
https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2bbb&disc=y&vers=925&s=4056&p=5117
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]