Restore the JSP mappings
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 7 Feb 2010 20:18:26 +0000 (20:18 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 7 Feb 2010 20:18:26 +0000 (20:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@907469 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/Context.java
java/org/apache/catalina/deploy/WebXml.java

index f7dba3e..d2c3ce4 100644 (file)
@@ -681,6 +681,19 @@ public interface Context extends Container {
 
 
     /**
+     * Add a new servlet mapping, replacing any existing mapping for
+     * the specified pattern.
+     *
+     * @param pattern URL pattern to be mapped
+     * @param name Name of the corresponding servlet to execute
+     * @param jspWildCard true if name identifies the JspServlet
+     * and pattern contains a wildcard; false otherwise
+     */
+    public void addServletMapping(String pattern, String name,
+            boolean jspWildcard);
+
+
+    /**
      * Add a resource which will be watched for reloading by the host auto
      * deployer. Note: this will not be used in embedded mode.
      * 
index 7eb8965..8246ad3 100644 (file)
@@ -1300,7 +1300,20 @@ public class WebXml {
         }
 
         // Do this last as it depends on servlets
-        // TODO
+        for (JspPropertyGroup jspPropertyGroup : jspPropertyGroups) {
+            String jspServletName = context.findServletMapping("*.jsp");
+            if (jspServletName == null) {
+                jspServletName = "jsp";
+            }
+            if (context.findChild(jspServletName) != null) {
+                context.addServletMapping(jspPropertyGroup.getUrlPattern(),
+                        jspServletName, true);
+            } else {
+                if(log.isDebugEnabled())
+                    log.debug("Skiping " + jspPropertyGroup.getUrlPattern() +
+                            " , no servlet " + jspServletName);
+            }
+        }
     }
     
     /**