• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml servlet's load-on-startup

 
Lynn Zhang
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My app uses WebSphere 8.0. In the web.xml I have two servlets: servlet1 and servet2. I would like servlet1 to be loaded when the serve starts but I would like servlet2 to be loaded when it is requested. Currently I am not setting up the load-on-startup at all for servlet2 (theory is if I am not setting this up at all or put a negative number for this tag, for example <load-on-startup>-4</load-on-startup>, the servlet will be loaded at webcontainer's decission). I have found out the servlet2 is loaded all the time when the server starts.

Any suggestion so that I let servlet2 only be loaded when it is requested, instead of during the server starts?

Thanks a lot!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. The container's contract is such that it must load the servlet as of its first request. Exactly when it decides to do that is up to the container so long as it fulfills that contract.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic