Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51278
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 2 Jun 2011 21:18:07 +0000 (21:18 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 2 Jun 2011 21:18:07 +0000 (21:18 +0000)
Changes required to original fix identified by TCK tests
Need to merge defaults before JSP->Servlet conversion since defaults define JSP servlet.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1130817 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/ContextConfig.java

index dba237b..3bf5fff 100644 (file)
@@ -1271,13 +1271,15 @@ public class ContextConfig
                     ok = webXml.merge(orderedFragments);
                 }
     
-                // Step 7. Convert explicitly mentioned jsps to servlets
+                // Step 7. Apply global defaults
+                // Have to merge defaults before JSP conversion since defaults
+                // provide JSP servlet definition.
+                webXml.merge(defaults);
+
+                // Step 8. Convert explicitly mentioned jsps to servlets
                 if (!false) {
                     convertJsps(webXml);
                 }
-
-                // Step 8. Apply global defaults
-                webXml.merge(defaults);
                 
                 // Step 9. Apply merged web.xml to Context
                 if (ok) {
@@ -1342,8 +1344,8 @@ public class ContextConfig
             }
         } else {
             // Apply unmerged web.xml to Context
-            convertJsps(webXml);
             webXml.merge(defaults);
+            convertJsps(webXml);
             webXml.configureContext(context);
         }
     }