dcsimg
How to deal with session expiry
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Richard_Giddings
Posted On:   Friday, June 6, 2003 03:17 PM

In the web site I am making the user logs in and a user bean is added to the session context. When the session expires beacuse the user has been away too long, then they try to carry on where they left off i get 'Cannot find bean user in any scope'. Ideally i'd like to forward them to some page to tell them to log back in, i saw that a ServletException was being thrown so i thought i'd do the following (struts- config.xml), key="internal.error" type="javax.servlet.ServletException" path="logout"/> Is this the correct way of handling it or am I way off the mark.    More>>

In the web site I am making the user logs in and a
user bean is added to the session context. When the
session expires beacuse the user has been away too
long, then they try to carry on where they left off i
get 'Cannot find bean user in any scope'. Ideally i'd
like to forward them to some page to tell them to log
back in, i saw that a ServletException was being
thrown so i thought i'd do the following (struts-
config.xml),


			


key="internal.error"
type="javax.servlet.ServletException"
path="logout"/>




Is this the correct way of handling it or am I way off the mark.



Thanks,



Richard

   <<Less

Re: How to deal with session expiry

Posted By:   AlessandroA_Garbagnati  
Posted On:   Saturday, June 7, 2003 01:34 AM

Richard,

I do handle something similar with a Filter. This is because my application doesn't use only Struts.


My filter do check that my UserBean is in the session. If not or it is expired, it just redirect to the login page.

About | Sitemap | Contact