cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: Inconsistent behavior of session handling
Date Sat, 09 Jul 2005 05:27:41 GMT
Messing, Elad wrote:
> Hello all
> 	I have encountered an inconsistent behavior of cocoon in
> relation to session handling.
> 	First I had this in my sitemap :
> 
>       <map:match pattern="session">
>         <map:act type="session">
>           <map:parameter name="action" value="create"/>
>         </map:act>
>         <map:call function="testSession"/>
>       </map:match>
>       <map:match pattern="session.html">
>         <map:generate type="jx" src="content/session.html"/>
>         <map:serialize/>
>       </map:match>
> 	
> 	testSession:
> 
> 	function testSession(){
> 		cocoon.sendPage("session.html");
> 	}
> 
> 	and in session.html I used JX to print the some session
> information:
> 	${cocoon.session.getAttribute("elad")}
> 	${cocoon.session.creationTime}
> 
> 	Everything works fine.
> 
> 
> 	When I change the sitemap to :
>       <map:match pattern="session">
>         <map:act type="session">
>           <map:parameter name="action" value="create"/>
>         </map:act>
>         <map:generate type="jx" src="content/session.html"/>
>         <map:serialize/>
>       </map:match>
> 
> 	I get the session.html file empty.. Like the session is not
> there anymore because I didn't go through flow script ??
> 
> 	Is this a bug ? Feature ?


I guess it's not a bug in Cocoon session handling but a problem with an 
inconsistency in the not-refactored version of jx-template. your example should 
work fine with jx-template in trunk but not with jx-template in 2.1. there you 
should try ${session.getAttribute("elad")} instead of 
${cocoon.session.getAttribute("elad")}.

HTH

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Mime
View raw message