404906 servlets with load-on-startup = 0 are not fired up on jetty 9 startup

This commit is contained in:
Jan Bartel 2013-04-08 09:58:08 +10:00
parent 44ec0b3f49
commit 0965ca62e2
2 changed files with 4 additions and 5 deletions

View File

@ -71,7 +71,7 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
private static final Logger LOG = Log.getLogger(ServletHolder.class);
/* ---------------------------------------------------------------- */
private int _initOrder;
private int _initOrder = -1;
private boolean _initOnStartup=false;
private Map<String, String> _roleMap;
private String _forcedPath;
@ -179,7 +179,7 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
*/
public void setInitOrder(int order)
{
_initOnStartup=order>0;
_initOnStartup=order>=0;
_initOrder = order;
}
@ -329,7 +329,6 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
throws Exception
{
super.initialize();
if (_extInstance || _initOnStartup)
{
try

View File

@ -130,8 +130,8 @@ public class ServletContextHandlerTest
holder0.setInitOrder(0);
_server.start();
assertEquals(2,__testServlets.get());
assertThat(holder0.getServletInstance(),nullValue());
assertEquals(3,__testServlets.get());
assertThat(holder0.getServletInstance(),notNullValue(Servlet.class));
_server.stop();
assertEquals(0,__testServlets.get());