| Author |
session lost problem
|
kundan varma
Ranch Hand
Joined: Mar 08, 2004
Posts: 322
|
|
Hi all I am working on a project where we are storing session in stateful session bean.When the session gets lost depending on the session-timeout property of orion-ejb-jar,i want to open the login page again.Our architecture is much like struts using session bean from action classes.EJB's are deployed on oc4j release 3 presently.When i am trying to redirect the page using request dispatcher, it is giving null pointer exception.I am getting the request dispatcher object but cant invoke any of its method. PLz help thanks candy
|
SCJP1.4,SCBCD,SCEA,CNA
Failures are practice shoots for success.
|
 |
Stephen Huey
Ranch Hand
Joined: Jul 15, 2003
Posts: 618
|
|
|
You'll probably want to post in the EJB forum, don't you think?
|
 |
kundan varma
Ranch Hand
Joined: Mar 08, 2004
Posts: 322
|
|
HI huey i have also posted this to ejb forum but didnt got any reply yet THat why i thought some one from here may answer my questions THanks candy
|
 |
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
|
|
|
Moving this to the EJB forum.
|
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
|
 |
kundan varma
Ranch Hand
Joined: Mar 08, 2004
Posts: 322
|
|
THanks Morris for moving this to EJB Forum. BUt plz help. cab anybody answer my question.THanks in advance candy
|
 |
Kyle Brown
author
Ranch Hand
Joined: Aug 10, 2001
Posts: 3879
|
|
Candy, I think that the problem is we can't quite understand your question. Could you post a little snippet of the code that's failing and post the exception you're receiving? For instance, I can't even figure out if it's failing in your EJB container or in your Web Container from your question... Kyle
|
Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
|
 |
kundan varma
Ranch Hand
Joined: Mar 08, 2004
Posts: 322
|
|
HI Kyle Actually i myself was confused about the problem.Now i am clear.I have a requestActionServlet which instantiate comSession(HttpSErvletREquest req) object and comsession object instantiate comSessionListener object and put this object in request.setAttribute("comsess",comsessionlistener).THis listener object implements sessionBIndingLIstener and hence the method valueBOund and valueUnbound. I want to redirect the user to loging page from valueUNbound method.AS this method gets fired whenever session expires so i am not getting the request object to forward it to login page. Is it possible to redirect or forward a page from valueUNbound. Can you give me some solution. Thanks candy
|
 |
kundan varma
Ranch Hand
Joined: Mar 08, 2004
Posts: 322
|
|
HI kyle I am waiting for your reply.Have u understood my problem. THanks candy
|
 |
Kyle Brown
author
Ranch Hand
Joined: Aug 10, 2001
Posts: 3879
|
|
Now I see the problem. No, it's not possible to do a redirect from valueUnbound because there is no actual HttpRequest in progress when this method may run! The valueUnbound() method may run at any time -- not just during the handling of a request, since sessions expire on a timer. In fact, most of the time the method will run when the user is not making a request of the servlet. So you need to take a different tack on this. What most people do in this situation is to look to see if there IS an HttpSession for the user at the very beginning of every servlet request (or even in a Servlet filter prior to any servlet running). If the HttpSession is not present (meaning that the session has timed out, or was never created) then you redirect the user to the login page. Hope this helps. Kyle
|
 |
kundan varma
Ranch Hand
Joined: Mar 08, 2004
Posts: 322
|
|
THanks Kyle Yes now i am checking the same during request call and followed ur suggestion.ITs working fine. THanks again. candy
|
 |
Kyle Brown
author
Ranch Hand
Joined: Aug 10, 2001
Posts: 3879
|
|
Glad I could help. Kyle
|
 |
 |
|
|
subject: session lost problem
|
|
|