hy,

i would like to understand, in which context your servlet is running.
Is it located within the cocoon webapp, or is it located elsewhere?

from the redirect url i guess you are crossing webapplications ...

If this is the case, you have another problem with session preserving
over multiple webapps. there are solutions to this, but this is far
from trivial...

If your servlet runs in the same context as cocoon, then i can't see
at the moment, why you loose your session. from the standard
behaviour of a servlet container i would expect, that once a session
is created within one context, this session is kept. I dont think,
that xsp will always create new sessions. if create-session="true"
I would expect, it creates a session, if none is existing, but once a
session is created it should be keep living for subsequent requests...

After having saying this, i bet you cross webapp boundaries ...

regards, hussayn

Marco Rolappe wrote:

> hi roberto,
>
> the reason why your elements are empty probably are the following; the
> session accessed in your XSP might be different from the JSP's session.
> since you redirect without url encoding the redirect url, the session
> probably doesn't survive the redirect. now in the XSP you didn't specify the
> <xsp:page>'s attribute create-session="false" (which is handled by the
> session logicsheet), which defaults to "true", thus a new session is created
> in the XSP.

> I don't know if your sessions are cookie or url rewriting based. anyway, you
> should be url encoding the redirect url, see inline comments below.
>
> > -----Ursprüngliche Nachricht-----
> > Von: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]Im
> > Auftrag von Roberto Cipollini
> > Gesendet: Donnerstag, 6. Februar 2003 18:40
> > An: [EMAIL PROTECTED]
> > Betreff: Session problems
> >
> >
> > Hi.
> > I have a problem with a jsp page and a cocoon page.
> >
> > I use jsp to simply check a user/password and if all is right
> > then set some
> > variables in the session.setAttribute.
> >
> > I then redirect the user to a cocoon page in wich i should grab
> > the session
> > variable with some xsp-logic commands but....i can't see them!
> >
> > Ok...all of you are saying "What a stupid newbie" :). I know, but
> > pls, it's
> > been a lot of headaches trying to solve this but i still.....have
> > headaches.
> >
> > This is the code inside the jsp page:
> > ********************************
> > check_login.jsp
> > *********************************
> >
> >                      session.setAttribute( "username", theRealUser );
> >                      session.setAttribute( "azienda", theRealFirm);
> >
> >                     //pfw is my custom file format :)
> >                      response.sendRedirect( "/pfw/rv3/setup_env.pfw" );
>
> this line should be something like:
>
>                       response.sendRedirect(response.encodeRedirectURL
> ("/pfw/rv3/setup_env.pfw"));
>
> >
> > **************************************
> > cocoon page setup_env.pfw
> > ***************************************
> >
> > <?xml version="1.0"?>
> > <?cocoon-process type="xsp"?>
> > <?cocoon-process type="xslt"?>
> >
> > <xsp:page language="java"
> > xmlns:xsp="http://apache.org/xsp";
> > xmlns:xsp-session="http://apache.org/xsp/session/2.0";
> > xmlns:xsp-request="http://apache.org/xsp/request/2.0";
> > >
> >
> > <xsp:structure>
> >         <xsp:include>java.util.*</xsp:include>
> >          <xsp:include>java.io.*</xsp:include>
> >          <xsp:include>java.text.*</xsp:include>
> >        <xsp:include>javax.*</xsp:include>
> >        <xsp:include>javax.*</xsp:include>
> >     <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
> >   </xsp:structure>
> >
> > <PAGE>
> >
> >  <AZIENDA>
> >   <xsp-session:get-attribute name="azienda" />
> >  </AZIENDA>
> >
> > <UTENTE>
> > <xsp-session:get-attribute name="username" />
> > </UTENTE>
> >
> > </PAGE>
> >
> > </xsp:page>
> >
> >
> > ****************************************
> > the tag <AZIENDA> and <UTENTE> are always empty!!!
> > Can anyone help this stupid problem?
> >
> > thanks!
> > R.C.
> >
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> > For additional commands, e-mail:   <[EMAIL PROTECTED]>
> >
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>

--
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
D-50935 Köln
tel.:+49 221 56011 0
fax.:+49 221-56011 20
email:[EMAIL PROTECTED]



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

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to