You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ma...@swisscom.com on 2003/02/26 12:38:01 UTC

and JAVA sessions

What is the difference between these two sessions??? :


JAVA session:
<xsp:structure>
 <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
</xsp:structure>
...
<xsp:logic>
 Session session = null;
 ...
 session = request.getSession(true);
 session.setAttribute("user",user);
...
</xsp:logic>

--------------------------------------

XSP SESSION:
<xsp:page language="java" 
 xmlns:xsp="http://apache.org/xsp"
 xmlns:session="http://apache.org/xsp/session/2.0" 
>
...
<session:set-attribute
name="user"><xsp:expr>user</xsp:expr></session:set-attribute>
...


   	  
Is there a way to create and set a JAVA session and then get an
attribute with session-xsp, like
<session:get-attribute name="user"/>


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


AW: and JAVA sessions

Posted by Marco Rolappe <m_...@web.de>.
from within an XSP you can have a session be created by specifying the
<xsp:page>'s attribute @create-session="true" (this is handled by the
session logicsheet. this way a session will be created if it didn't yet
exist.

problems can occur with these sessions, though; sessions created by the
session logicsheet from within the XSP are created when actual generation
begins, i.e. after pipeline setup. thus, transformers in the pipeline (for
which the XSP is the generator) won't see the session instantly.

your safest bet is to create the session before the generator step (e.g. via
an action) and have the generator access this one via the session
logicsheet.

> -----Ursprungliche Nachricht-----
> Von: cocoon-users-return-47099-m_rolappe=web.de@xml.apache.org
> [mailto:cocoon-users-return-47099-m_rolappe=web.de@xml.apache.org]Im
> Auftrag von Maxime.Gheysen@swisscom.com
> Gesendet: Mittwoch, 26. Februar 2003 12:38
> An: cocoon-users@xml.apache.org
> Betreff: <xsp-session> and JAVA sessions
>
>
> What is the difference between these two sessions??? :
>
>
> JAVA session:
> <xsp:structure>
>  <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
> </xsp:structure>
> ...
> <xsp:logic>
>  Session session = null;
>  ...
>  session = request.getSession(true);
>  session.setAttribute("user",user);
> ...
> </xsp:logic>
>
> --------------------------------------
>
> XSP SESSION:
> <xsp:page language="java"
>  xmlns:xsp="http://apache.org/xsp"
>  xmlns:session="http://apache.org/xsp/session/2.0"
> >
> ...
> <session:set-attribute
> name="user"><xsp:expr>user</xsp:expr></session:set-attribute>
> ...
>
>
>
> Is there a way to create and set a JAVA session and then get an
> attribute with session-xsp, like
> <session:get-attribute name="user"/>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


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