Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2013-04-07 19:58:08 -0400
committerJan Bartel2013-04-07 19:58:46 -0400
commit0965ca62e286479ccaa8efcf8e19257504f8d9f8 (patch)
treecdf8fb15f77cb3fbb7893653d3d13f5a926f767e
parent44ec0b3f49f6d540a9745b13d0edcbd1c2f63f8e (diff)
downloadorg.eclipse.jetty.project-0965ca62e286479ccaa8efcf8e19257504f8d9f8.tar.gz
org.eclipse.jetty.project-0965ca62e286479ccaa8efcf8e19257504f8d9f8.tar.xz
org.eclipse.jetty.project-0965ca62e286479ccaa8efcf8e19257504f8d9f8.zip
404906 servlets with load-on-startup = 0 are not fired up on jetty 9 startup
-rw-r--r--jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java5
-rw-r--r--jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java4
2 files changed, 4 insertions, 5 deletions
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
index 6de3b7e48b..1e50dd1249 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
@@ -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
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java
index 4c06368b4b..b923e53d8c 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java
@@ -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());

Back to the top