Fix FindBugs identified error in Servlet 2.2 jspFile handling
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 26 Feb 2011 20:44:34 +0000 (20:44 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 26 Feb 2011 20:44:34 +0000 (20:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1074919 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/ContextConfig.java
webapps/docs/changelog.xml

index 65e3387..ee56360 100644 (file)
@@ -1337,7 +1337,6 @@ public class ContextConfig
     private void convertJsp(ServletDef servletDef, ServletDef jspServletDef) {
         servletDef.setServletClass(org.apache.catalina.core.Constants.JSP_SERVLET_CLASS);
         String jspFile = servletDef.getJspFile();
-        servletDef.getParameterMap().put("jspFile", jspFile);
         if ((jspFile != null) && !jspFile.startsWith("/")) {
             if (context.isServlet22()) {
                 if(log.isDebugEnabled())
@@ -1349,6 +1348,7 @@ public class ContextConfig
                     (sm.getString("contextConfig.jspFile.error", jspFile));
             }
         }
+        servletDef.getParameterMap().put("jspFile", jspFile);
         servletDef.setJspFile(null);
         for (Map.Entry<String, String> initParam: jspServletDef.getParameterMap().entrySet()) {
             servletDef.addInitParameter(initParam.getKey(), initParam.getValue());
index f4430f9..250ef0f 100644 (file)
         Ensure a web application is taken out of service if the web.xml file is
         not valid. (kkolinko/markt)
       </fix>
+      <fix>
+        Ensure Servlet 2.2 jspFile elements are correctly converted to use a
+        leading &apos;/&apos; if missing. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">