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

Reply via email to