cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: <map:mount> and sitemap params
Date Wed, 06 Mar 2002 14:26:35 GMT
> From: Kai Bruns [mailto:bruns@dialog.uni-oldenburg.de]
> 
> 
> I'm using Cocoon 2.0.1 on Tomcat 4.0.1. I've set up my main sitemap to
> match different sub-uris and then mount a sub-sitemap for the
corresponding
> sub-directory the way it's done in the cocoon sub-sitemap example. In
> addition I want to do user authentication for a whole subsitemap in
the
> main sitemap this way:
> 
> 
> <map:match pattern="sub/**">
>   <map:act type="session-validator">
>     <map:parameter name="descriptor" value
> ="context://descriptors/params.xml"/>
>     <map:parameter name="validate" value="username"/>
>   </map:act>
>   <!-- something was wrong, redirect to login page -->
>   <map:redirect-to uri="../login"/>
> </map:match>
> 
> 
> So far so good, although I do not understand why I must use
> <map:redirect-to uri="../login"/> with prefix '../' in my main
sitemap,
> maybe that's already a hint for a problem.
> 
> What I wanted to do is to access the sitemap param 'username' in the
> subsitemap, which does not work.

You are right. This does not work.

Vadim

> I tried the following entry in my
> subsitemap:
> 
> 
> <map:match pattern="*.html">
>   <map:generate src="docs/{1}.xml"/>
>   <map:transform src="../stylesheets/mystyle.xsl">
>     <map:parameter name="use-request-parameters" value="true"/>
>     <map:parameter name="username" value="{../username}"/>
>   </map:transform>
>   <map:serialize/>
> </map:match>
> 
> 
> That throws an Exception when calling a subsite page (being already
> authenticated, of course):
> 
> org.apache.cocoon.sitemap.PatternException: error occurred during
> evaluation of expression "{../username}" at position 1 Index: -1,
Size: 1
> at
>
org.apache.cocoon.sitemap.AbstractSitemap.substitute(AbstractSitemap.jav
a:322)
> 
> at
>
org.apache.cocoon.www.region.sitemap_xmap.matchN100BE(sitemap_xmap.java:
1029)
> 
> at
org.apache.cocoon.www.region.sitemap_xmap.process(sitemap_xmap.java:600)
> at
org.apache.cocoon.www.region.sitemap_xmap.process(sitemap_xmap.java:518)
> at org.apache.cocoon.sitemap.Handler.process(Handler.java:180) at
> org.apache.cocoon.sitemap.Manager.invoke(Manager.java:127) at
> org.apache.cocoon.www.sitemap_xmap.matchN10250(sitemap_xmap.java:1991)
at
> org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:1437) at
> org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:1348) at
> org.apache.cocoon.sitemap.Handler.process(Handler.java:180) at
> org.apache.cocoon.sitemap.Manager.invoke(Manager.java:127) at
>
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:144
)
> at org.apache.cocoon.Cocoon.process(Cocoon.java:582) at
>
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:795)
at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFi
> lterChain.java:247)
> 
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChai
> n.java:193)
> 
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java
> :243)
> 
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566
> )
> 
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java
> :201)
> 
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566
> )
> 
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
4)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:164)
> 
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566
> )
> 
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.ja
> va:170)
> 
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564
> )
> 
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:170)
> 
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564
> )
> 
> at
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462
)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564
> )
> 
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:1
> 63)
> 
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566
> )
> 
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
ava:10
> 11)
> 
> at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
1106)
> 
> at java.lang.Thread.run(Thread.java:484)
> 
> 
> I also tried to use {username} instead if {../username} which of
course did
> not work because there is no sitemap param username on the param stack
top.
> 
> Did I expect the wrong behaviour in param-handling when using
<map:mount>
> or did I do any other mistake?
> 
> Thanks for help,
> 
> 
> Dipl.-Inform. Kai Bruns
> regio gmbh
> Institut für Regionalentwicklung und Informationssysteme
> an der Carl von Ossietzky Universität Oldenburg
> D-26111 Oldenburg
> Tel ++49 (0)441 798-2827
> Fax ++49 (0)441 798-3002
> eMail bruns@regio.uni-oldenburg.de
> http://www.regio.uni-oldenburg.de
> 


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message