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: accessing session context from stylesheet
Date Thu, 18 Apr 2002 15:01:05 GMT
> From: Franosch, Heike [mailto:franosch@bms.de]
> 
> > :)
> > Of course your servlet won't see session of the client, you
> > invoke this
> > servlet from the server, not from the browser.
> >
> > You must pass jsessionid request parameter manually to this servlet.
I
> > hope you already did this and have jsessionid in the
> > {requestQuery}. If
> > not, add it.
> 
> Mhh, sorry to ask, but how is it done?
> I thought it would be something simply like:
>  <map:generate
>
src="http://localhost:8080/cocoon/servlet/testpackage.{../2};jsessionid=
{ses
> sion-id}{requestQuery}"/>
> 
> But at this time the {session-id} ist not set.
> Do I have to write some code to perform this?

Yes. Below.


> Thanks, Heike
> 
> ---
> Here again my whole environment:
> <!-- test servlet -->
>  <map:pipelines>
>   <map:pipeline>
>    <map:match pattern="testpackage/*/*">

Assuming that the action "request" returns you {session-id} parameter,
you can write very simple action ("request.getSession(true); return
EMPTY_MAP;") and invoke it here like this:

<map:act type="my-create-session-action"/>


>    <map:act type="request">

And here you will have {session-id} of newly created session (I assume
action "request" returns this variable).

Vadim

>      <map:parameter name="parameters" value="true"/>
> 
>    <map:generate
>
src="http://localhost:8080/cocoon/servlet/testpackage.{../2};jsessionid=
{ses
> sion-id}{requestQuery}"/>
> 
>    <map:transform type="xslt" src="testpackage/{../1}/{../2}.xsl">
> 
>        <map:parameter name="use-session-info" value="true"/>
>        <map:parameter name="session-id" value="{session-id}"/>
>        <map:parameter name="session-is-new" value="{session-is-new}"/>
>        <map:parameter name="session-available"
> value="{session-available}"/>
>        <map:parameter name="no" value="{no}"/>
>    </map:transform>
>    </map:act>
>    <map:serialize type="html">
>      <encoding>ISO-8859-1</encoding>
>    </map:serialize>
>  </map:match>
> 
>   </map:pipeline>
>  </map:pipelines>


---------------------------------------------------------------------
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