cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Daniel <alexander.dan...@gmx.at>
Subject Re: [C2.2] Sitemap: Block Context Path
Date Fri, 10 Oct 2008 13:23:39 GMT
On 06.10.2008, at 14:05, Matthias Müller wrote:

> what's the easiest way to get the context path of the current block  
> (the project root)?
> i want to to use a parameter $myContextPath in my sitemap to work in  
> a jx template, like this:
>
> <map:generate type="jx" src="resource/internal/fonts/fop-config.jxt">
>      <map:parameter name="myContextPath" value="context://"/>
> </map:generate>


With these input modules

<map:transform src="demo/welcome.xslt">
	<map:parameter name="servlet" value="{servlet:}"/>
	<map:parameter name="block-path" value="{block-path:}"/>
	<map:parameter name="realpath" value="{realpath:/}"/>
	<map:parameter name="contextpath" value="{contextpath:}"/>
</map:transform>

I get following output when I run the block with mvn jetty:run:

servlet: /maintenance
block-path: /maintenance
realpath: file:/Users/alex/dev/cocoon/spikes/maintenance/./src/main/ 
resources/COB-INF/
contextpath: ///Users/alex/dev/cocoon/spikes/maintenance/./src/main/ 
resources/COB-INF/

Probably contextpath is what you are looking for.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message