• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

web.xml servlet's load-on-startup

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic