• 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 validation/invalidation

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I cause a forced session invalidation for timeouts, manual logouts and such when using struts?

How can I check that a session is still valid and the user is still logged in using struts?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bloo,

You can invalidate the session using:

(Note that this is a standard J2EE function, not specific to Struts)


If a session is still valid, then calling:


will return a non-null session. However I have a feeling Struts will automatically create the session (if it does not exist) before any Action is called. You may need to create a custom RequestProcessor or ServletRequestListener to intercept the call before this happens.

Hope that helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic