Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which listener executes last when web application is shutdown

 
kamalakannan kamal
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

The last listener methods potentially called when web application is shutdown are those in those classes implementing ServletContextAttributeListener. The web container removes attributes from the context after the ServletContextListener.contextDestroyed() method has completed, which may cause calls to ServletContextAttributeListener.attributeRemoved().

Is this correct?
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All three methods of ServletcontextAttributListener are called prior to the ServletContextListener's contextDestroyed()method.
Means when the server going to shutdwon the ServletContextListener's contextDestroyed() method will be the last method to run.
 
kamalakannan kamal
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anand for your reply.

I am using "Sun Certified Web Component Developer Study Guide" by David Bridgewater. In that they have mentioned like this "The last listener methods potentially called are those in those classes implementing
ServletContextAttributeListener. The web container removes attributes from the context after the ServletContextListener.contextDestroyed() method has completed, which may cause calls to ServletContextAttributeListener.attributeRemoved()."
Even i tried with some programs writing ServletContextListener and ServletContextAttributeListener with all methods. The last listener methods called are those in ServletContextListener class.

Thanks,
G. Kamal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic