Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • 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...
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic