java - How does container handle servlet request before load-on-startup? -
this question has answer here:
i'm trying guarantee order of init method calls on couple of servlets. thought specify load-on-startup value of 1 first servlet want initialize , value of 2 load-on-startup value of second servlet want initialize.
my question happens if request servlet 2 before servlet 1 initialization completes?
hi jarrod, don't believe question duplicate. thanks, charlie
a request not handled web application before web application has started up. if specify non-negative load-on-startup value, means servlet init() method invocation occur during web application startup. result, such servlet not handle request until init() method has finished.
so servlet container call init() on servlets non-negative load-on-startup (in order) , allow them handle requests.
tomcat 7 default configuration delays requests received during application startup (at least, in case).
more information on tomcat specifics in answer prevent tomcat caching request during starup
Comments
Post a Comment