• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

ActionServlet destroy()

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the destroy() method in the ActionServlet where I would place tasks such as invalidating a session, updating DB info for the user like isLoggedIn, and things like that?
Also, when does this method get called?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I figured out that when the session timesout, I don't need to invalidate the session. So I think I am alright there.
However, I am still needing to find out some information.
When the session times out, I need to modify the database. But I still need some of the information that is contained in the session. Specifically my UserBean because I need to update the database with the fact that the user has logged out. So I still need to find out when the destroy() method gets called and if there is a method somewhere I can override when the session gets invalidated by the App Server so I can still have by Session for a brief moment.
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out that I need to use HttpSessionBindingListener which has nothing to do with STRUTS. So if anyone is interested in what I am doing, you can go to https://coderanch.com/t/357108/Servlets/java/SessionBindingListener
Thanks.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, with Struts 1.1 you should never need to override the ActionServlet...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Chris Mathews:
In general, with Struts 1.1 you should never need to override the ActionServlet...


Maybe you and Junilu Lacar could start a good thread as to why one would override the ActionServlet. Since he suggested I do that...
 
Dinner will be steamed monkey heads with a side of tiny ads.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic