Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionServlet destroy()

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 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 http://www.coderanch.com/t/357108/Servlets/java/SessionBindingListener
Thanks.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic