• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Query reg JSP session

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The session object is by default available in JSP. I want to know if the session is timed out, then does it create a new HttpSession and returns that or it return null.

If it creates a new session, how can I stop that and re-direct user to session timed out page?

Thanks!
 
P Lavti
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the answer that by using page session="false" it wont create a bew session. and the existing session can be taken from request.

But if the session is expired then how can I re-direct the user to log-out page is still a question from me.

I know one way is to manually redirect the user to logout page if session is NULL.

Is there a way to do the same using JSP page directives?

Thanks!
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't we map a error page(actually a signup Page) in web.xml to the exception or the error code which would be thrown for a invalid session?

I am not able to find error code for this exception.
 
Ashok Kumar Babu
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Latvi,

In the sessionDestroyed method of SessionListener, forward to the signup page using the Servlet Context's request dispatcher.

Any Suggestions?
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic