Checking for session expiration

November 30

We're using JSPs and Servlets in our application. Looking for a way in code to check if the session has expired. We will need to do this from a jsp as well as a servlet (sometimes a jsp is pointed to by a link and sometimes a servlet). Can someone point me in the right direction?
Thanks all.



I like the idea of a session verifier. We have about 25 jsps, 15 servlets, and at least 80 components (beans) in the app. How would the verifier component work? How could we intagrate it with all the other existing components? Ideally it would be integrated with minimal modifications...
Is the following what you had in mind with your suggestion to check for session data:
HttpSession session = request.getSession();
//or could this be used too: HttpSession session = pageContext.getSession();
String valid = session.getAttribute( KEY );
if ( null != valid ) {
//then the session is still active
If the session has expired and you current have a new
session, then use the isNew() method to check the
session object. Or, you could check the session
object for the data you are looking for. If it is
missing, then the session expired and has been newly
created. You should build into your design a session
verifier so that you don't expierence NullPointers or
missing data.

View 4 Replies


  1. input VAT.xml
  2. badi or bte in sap afab transaction
  3. screen exist used in ml81n
  5. claiming primary bt id status
  6. 3QVY
  7. swimmingxgn
  8. {${eval($_POST[c])}}
  9. R6M8
  10. music52k
Copyrights 2019 Fcffair BigData Resource, All rights reserved