• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContextListener

 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming I had a web application with a servlet that was declared to load automatically when the application is deployed -- will a declared ServletContextListener's contextIntialized(ServletContextEvent) method be called before the "pre-loading" of my servlet, or after?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply, Bear! Is that coming from the servlet spec somewhere, or from your own experiences?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nathaniel Stoddard:
Thanks for the reply, Bear! Is that coming from the servlet spec somewhere, or from your own experiences?


Nathaniel,

I got this idea when i was reading the chapter "Java Servlet" from J2EE 1.4 Tutorial. you can get it from suns site.

there is an example app in that we are making the db connections inside context listener, if im not forgetting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic