I think the problem with this is that the session is new on the login page
and is not established
until the request is sent back to the client.

for instance...

loginPage starts a new session, and sets a bean in the session.
loginPage then forwards the request to another page.
the other page will not know yet that a session has been established because
the response has not yet gone back to the client.

I think if you reattempted the scenario again, the second login will work..

you probably worked this already though....

> -----Original Message-----
> From: Sibon Barman [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, July 06, 2001 1:48 PM
> To:   [EMAIL PROTECTED]; struts
> Subject:      RE: Session atribute lost on forward
> 
> 
> Hi,
> Did you ever figure out the solution for the problem ---- I have the exact
> same problem.
> 
> Sibon Barman
> SS8 Networks, Inc.
> Suite 500
> 495 March Road, Kanata,
> Ontario K2K 3G1
> 
> *: (613)592-2100 ext:3281
> *: [EMAIL PROTECTED]
> 
> 
> 
> -----Original Message-----
> From: Shkuro, Yuri [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 20, 2001 12:56 PM
> To: '[EMAIL PROTECTED]'
> Subject: Session atribute lost on forward
> 
> 
> Sorry for a question not directly related to struts.
> 
> My app is always enterred through login.do action, which authenticates
> the user and sets a login bean in session attribute and returns some
> forward based on user access level.  However, when the forward page is
> displayed (along with the list of session attributes), the login bean
> is not there if the session has isNew()==true.  If you hit reload, the
> session.isNew()==false and the attribute appears.  It seems that when
> I store something in a new session and then do an internal forward,
> the request in the second page doesn't have info about the session, and
> all attributes are lost.  Any idea how to fix this?
> 
> This is on Tomcat 3.2.1.  Here is the action class's perform() method.
> 
>     public ActionForward perform(ActionMapping mapping,
>                                                               ActionForm
> form,
> 
> HttpServletRequest request,
> 
> HttpServletResponse response)
>         throws IOException, ServletException
>       {
>               String sKerberosID = request.getRemoteUser();
> 
>               // create login bean for this user & this application
>               LoginBean login = new LoginBean( sKerberosID );
> 
>               // store login bean as a session-scope bean
>               request.getSession().setAttribute( LoginBean.getKey(), login
> );
> 
>               return mapping.findForward( login.getSuperuser() ?
> "superuser" : "success" );
>     }

Reply via email to