• 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

session expiring causes problems...

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If a browser window is left open for a some time while the user is logged in and the session expires, tomcat shows an ugly error message to the user. Is there a way to prevent this? Like automatically displaying a login page when the session has timed out? Please help...
Many thanks
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe you can edit the default timeout period for a session. From BEGINNING JSP (Wrox):
"The developer can also change this timout using the setMaxInactiveInterval() method; the timeout period used by these methods is defined in seconds. If the timeout period for a session is set to -1, the session will never expire."
You can also edit your web.xml like this:
[CODE]
<webapp>
<session-config>
<session-timeout>-1</session-timeout>
</session-config>
</webapp>
[CODE]
I believe another option would be to use Tomcats built in form based log in mechanism. Then if your session times out, your are automatically sent to the login page in which you must reenter your username and password.
Hope this helps
 
Zac Roberts
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the above code, ignore the:
[CODE]
[CODE]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic