openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1791148 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java
Date Wed, 12 Apr 2017 16:45:29 GMT
Author: rmannibucau
Date: Wed Apr 12 16:45:29 2017
New Revision: 1791148

URL: http://svn.apache.org/viewvc?rev=1791148&view=rev
Log:
some check to ensure we don't redefine what is already there when adding jsp servlet

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java?rev=1791148&r1=1791147&r2=1791148&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java
Wed Apr 12 16:45:29 2017
@@ -44,13 +44,15 @@ public class TomcatAutoInitializer imple
         try {
             final String jsp = "org.apache.jasper.servlet.JspServlet";
             TomcatAutoInitializer.class.getClassLoader().loadClass(jsp);
-            final ServletRegistration.Dynamic jspDef = ctx.addServlet("default", jsp);
-            jspDef.setInitParameter("fork", "false");
-            jspDef.setInitParameter("xpoweredBy", "false");
-            jspDef.setInitParameter("development", "false");
-            jspDef.setLoadOnStartup(3);
-            def.addMapping("*.jsp");
-            def.addMapping("*.jspx");
+            final ServletRegistration.Dynamic jspDef = ctx.addServlet("jsp", jsp);
+            if (jspDef != null) {
+                jspDef.setInitParameter("fork", "false");
+                jspDef.setInitParameter("xpoweredBy", "false");
+                jspDef.setInitParameter("development", "false");
+                jspDef.setLoadOnStartup(3);
+                def.addMapping("*.jsp");
+                def.addMapping("*.jspx");
+            }
         } catch (final NoClassDefFoundError | ClassNotFoundException e) {
             // not there, skip
         }



Mime
View raw message