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 Wed, 17 Apr 2002 19:22:00 GMT
> From: Franosch, Heike [mailto:franosch@bms.de]
> 
> Hi Vadim,
> 
> thanks for your answer. I did a lot of more testing trying to figure
it out.
> But, I still just can't get it run.
> 
> > This is wrong and never will work. You either specify this parameter
> > when declaring transformer like this:
> >
> > <map:transformer name="xslt" src="org.apache...">
> >   <use-session-info>true</use-session-info>
> >
> >
> > or here, but only supported syntax is map:parameter:
> >
> > <map:transform type="xslt" src="testpackage/{1}/{2}.xsl">
> >   <map:parameter name="use-session-info" value="true"/>
> 
> I tried your suggestion. But with no success.
> When I query the parameters in my stylesheet the session-id is
> empty.

Then, it means, you did not passed this parameter to the stylesheet.


> use-session-info is true
> session-available is false
> 
> When I do some ugly hardcoding and put the encoded URL to the
> xml and copy it to the output, and then reaccess my servlet
> the session is also null. Is it possible that the jsessionid is
> stripped off the URL from cocoon? Is there a way to get it?

(IIRC) response.encodeUrl() will return you URL with the jsessionid
parameter if cookies are not enabled.


> I have attached my coding. Maybe I am just using it wrong.
> I am really greatful for further help.
> 
> Thanks, Heike
> 
> ----------
> Here is my snippet from sitemap:
> 
> <!-- test servlet -->
>  <map:pipelines>
>   <map:pipeline>
> 
>  <map:match pattern="testpackage/*/*">
>    <map:act type="request">
>      <map:parameter name="parameters" value="true"/>
> 
> 	 <map:generate
>
src="http://localhost:8080/heike/servlet/testpackage.{../2}{requestQuery
}"/>
> 
>    <map:transform type="xslt" src="testpackage/{../1}/{../2}.xsl">
>        <map:parameter name="use-session-info" value="true"/>

This looks ok. Take a look at TraxTransformer if you want to know how it
works.


>        <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}"/>

How do you know that these four variables you use are set? Check log
file, if you have DEBUG level, it will have log entries saying what
values were used to substitute variables.


>    </map:transform>
>    </map:act>
>    <map:serialize type="html">
>      <encoding>ISO-8859-1</encoding>
>    </map:serialize>
>  </map:match>
> 
>   </map:pipeline>
>  </map:pipelines>
> 
> <!-- transformer -->
>    <map:transformer name="xslt"
logger="sitemap.transformer.xslt"
>
src="org.apache.cocoon.transformation.TraxTransformer"
>                     pool-max="32" pool-min="16" pool-grow="4">
>     <use-request-parameters>false</use-request-parameters>
>     <use-browser-capabilities-db>false</use-browser-capabilities-db>
>    <use-session-info>true</use-session-info>
>     <use-deli>false</use-deli>
>    </map:transformer>

This is also ok.

Vadim



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