File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Session is not expired after specified time period Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session is not expired after specified time period " Watch "Session is not expired after specified time period " New topic
Author

Session is not expired after specified time period

Raghu Sha
Ranch Hand

Joined: Feb 02, 2013
Posts: 120
After session got expired, it is not redirect to specified page.



web.xml



It is not valdating inside IF condition.
Please suggest

Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

Am I missing something? How is 'response' initialised ?

Also, I thought the session listener methods sessiomCreated() and sessionDestroyed() are called asynchronous to a servlel request so one does not have a valid HttpServletResponse to re-direct.
Raghu Sha
Ranch Hand

Joined: Feb 02, 2013
Posts: 120
Sorry.. I only missd.

If there is no session, it should have response object? Am i correct?
Please suggest, how i can handle session timeout, if it expires it should go login page
Rajasekhar Eega
Greenhorn

Joined: Jul 31, 2012
Posts: 11
I think you can do it by using Filter also....



web.xml for filter configuration
--------------------------------------



I hope it would be helpful to you.....
Raghu Sha
Ranch Hand

Joined: Feb 02, 2013
Posts: 120
I tried same way. But Filter itself not called.
Any other things need to configure apart from that?
I put sop inside doFilter,it is not getting printed.

using Filter it should recogize session-timeout configred in web.xml?

I am using Spring MVC. Do i need to configure in spring-servlet.xml for filter configuration?
Sourabh Bawage
Ranch Hand

Joined: Sep 03, 2013
Posts: 33

i think the session is not invalidated.....did you debug and check for the values??


SCJP
 
Consider Paul's rocket mass heater.
 
subject: Session is not expired after specified time period
 
Similar Threads
time out period defined by the servlet container?
how to handle session timeout
session data in sessionDestroyed method
Problem with session timeout
Why my SipServlet throwing "SipApplicationSession is not valid." exception ?