init() called for the first HTTP request, why not earlier?
Joined: Jan 08, 2005
It seems the init() method from the Servlet interface is called when the first HTTP request is made. This means that the first client always incurs the overhead of all the initialisation. Is it possible to set the servlet container to invoke init() in a web application as soon as the server (Tomcat) is started, rather than it sitting idle waiting for a request and then invoking init()? I can understand it having to compile JSP files (although you can pre-compile them), but I do quite a bit of I/O to setup the environment for the webapp in init() and don't want the first client to have to wait even longer. I would like the application to be 100% ready as soon as its started without having to fire up a browser to make a request, which does the initialisation before its _ready_ for production. [ May 18, 2005: Message edited by: Kashif Riaz ]