Author: markt Date: Sat Aug 11 18:58:49 2012 New Revision: 1371997 URL: http://svn.apache.org/viewvc?rev=1371997&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53574 Ensure Servlets defined using jsp-file are available when metadata-complete is true.
Added: tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/jsp/ - copied from r1371995, tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/ tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp - copied unchanged from r1371995, tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestContextConfig.java tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/web.xml tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1371995 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1371997&r1=1371996&r2=1371997&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java Sat Aug 11 18:58:49 2012 @@ -1339,6 +1339,7 @@ public class ContextConfig implements Li } } else { webXml.merge(defaults); + convertJsps(webXml); webXml.configureContext(context); } Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestContextConfig.java?rev=1371997&r1=1371996&r2=1371997&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestContextConfig.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestContextConfig.java Sat Aug 11 18:58:49 2012 @@ -29,6 +29,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import junit.framework.Assert; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -94,6 +96,26 @@ public class TestContextConfig extends T assertTrue(bc.toString().contains("<p>OK</p>")); } + @Test + public void testBug53574() throws Exception { + Tomcat tomcat = getTomcatInstance(); + + File appDir = new File("test/webapp-3.0"); + tomcat.addWebapp(null, "/test", appDir.getAbsolutePath()); + + tomcat.start(); + + ByteChunk res = new ByteChunk(); + + int rc = getUrl("http://localhost:" + getPort() + + "/test/bug53574", res, null); + + Assert.assertEquals(HttpServletResponse.SC_OK, rc); + + String body = res.toString(); + Assert.assertTrue(body.contains("OK")); + } + private static class CustomDefaultServletSCI implements ServletContainerInitializer { Modified: tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/web.xml?rev=1371997&r1=1371996&r2=1371997&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/web.xml (original) +++ tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/web.xml Sat Aug 11 18:58:49 2012 @@ -113,6 +113,15 @@ <url-pattern>/testStandardWrapper/securityAnnotationsMetaDataPriority</url-pattern> </servlet-mapping> + <servlet> + <servlet-name>Bug53574</servlet-name> + <jsp-file>/WEB-INF/jsp/bug53574.jsp</jsp-file> + </servlet> + <servlet-mapping> + <servlet-name>Bug53574</servlet-name> + <url-pattern>/bug53574</url-pattern> + </servlet-mapping> + <login-config> <auth-method>BASIC</auth-method> </login-config> Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1371997&r1=1371996&r2=1371997&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat Aug 11 18:58:49 2012 @@ -103,6 +103,10 @@ VirtualDirContext. Patch provided by Philip Zuev. (markt) </fix> <fix> + <bug>53574</bug>: Ensure Servlets defined using jsp-file are available + when metadata-complete is true. (markt) + </fix> + <fix> <bug>53584</bug>: Ignore path parameters when comparing URIs for FORM authentication. This prevents users being prompted twice for passwords when logging in when session IDs are being encoded as path parameters. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org