Author: markt Date: Sat Aug 11 18:54:53 2012 New Revision: 1371995 URL: http://svn.apache.org/viewvc?rev=1371995&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/trunk/test/webapp-3.0/WEB-INF/jsp/ tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java tomcat/trunk/test/webapp-3.0/WEB-INF/web.xml Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1371995&r1=1371994&r2=1371995&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Sat Aug 11 18:54:53 2012 @@ -1245,6 +1245,7 @@ public class ContextConfig implements Li } } else { webXml.merge(defaults); + convertJsps(webXml); webXml.configureContext(context); } Modified: tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java?rev=1371995&r1=1371994&r2=1371995&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java (original) +++ tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java Sat Aug 11 18:54:53 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 { Added: tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp?rev=1371995&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp (added) +++ tomcat/trunk/test/webapp-3.0/WEB-INF/jsp/bug53574.jsp Sat Aug 11 18:54:53 2012 @@ -0,0 +1,21 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> +<html> + <body> + <p>OK</p> + </body> +</html> \ No newline at end of file Modified: tomcat/trunk/test/webapp-3.0/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0/WEB-INF/web.xml?rev=1371995&r1=1371994&r2=1371995&view=diff ============================================================================== --- tomcat/trunk/test/webapp-3.0/WEB-INF/web.xml (original) +++ tomcat/trunk/test/webapp-3.0/WEB-INF/web.xml Sat Aug 11 18:54:53 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> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org