• 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 timeout manamement

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm using weblogic 9.2, struts and I am managing the timeout in the web.xml
When the timeout occur I am redirected to the login page.
My problem is I want to show a message like "Timeout! please login again" how can I achieve this?

Thanks
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not 100% sure of what I am saying now so you want to check.

Upon timeout, the session is invalidated. Hence sessionDestroyed(HttpSessionEvent e) should be called.

By implementing the HttpSessionListener, then checking inactive time you should be able to achieve what you are looking for.
 
Hadler Yunkel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sebastian
if I use a SessionListener and forward the user on the sessionDestroyed method my user will be kicked out without pressing any button and I don't want to force the logout like that, I will prefer to do not implement costom code and live the session managment to my app server
I was wondering if there it can be achieved by configuring web.xml or something

for instance, in my web.xml I've my login form configured like this:

<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/login.jsp?auth=false</form-error-page>
</form-login-config>
</login-config>

So I can manage the auth false message...is there something for the timeout as well?

Thanks
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there is a way completely through web.xml for what you are trying to achieve

You should try giving a message in form of a pop-up surface on the page when you move away from the page. this is usually done by keeping a div in the page in hidden form and showing it when the session times out. you can also use java script to call the login form in this pop up message itself.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic