File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes ServletContextListener Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "ServletContextListener" Watch "ServletContextListener" New topic
Author

ServletContextListener

Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
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?


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56177
    
  13

Before.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Thanks for the reply, Bear! Is that coming from the servlet spec somewhere, or from your own experiences?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletContextListener
 
Similar Threads
Error 400: Invalid path /main was requested
Init Params doubt
Startup Beans On Application Deployment
Servlet Context parameters
debugjsp servlet