Reputation: 532
I have a tomcat webapp which has a dependency on another application (which will mostly not have started up when tomcat starts), so my initialization fails.
I want to know if there is a way to skip the initialization of my webapp at tomcat startup and initialize it only when my servlet gets a request.
Upvotes: 1
Views: 567
Reputation: 864
load-on-startup Tag facilitate the servlet to preinitialization just remove the tag you will get lazy loading which you want
Upvotes: 1
Reputation: 11487
By default your servlet
will be initialised only when its first invoked, unless you stated otherwise in your web.xml
using load-on-startup
parameter.
Upvotes: 2
Reputation: 77234
Don't set load-on-startup
. Alternatively, you can set load-on-startup
for the dependent servlet to a higher value than that of the servlet it depends on to ensure that they'll be started in order.
Upvotes: 0