tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1354667 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ApplicationContext.java test/org/apache/catalina/core/TestApplicationContext.java test/webapp-3.0/bug53467].jsp webapps/docs/changelog.xml
Date Wed, 27 Jun 2012 18:55:00 GMT
Author: markt
Date: Wed Jun 27 18:54:58 2012
New Revision: 1354667

URL: http://svn.apache.org/viewvc?rev=1354667&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53467
Use more explicit URI constructor to ensure components are correctly encoded.

Added:
    tomcat/tc7.0.x/trunk/test/webapp-3.0/bug53467].jsp
      - copied unchanged from r1354664, tomcat/trunk/test/webapp-3.0/bug53467].jsp
Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationContext.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1354664

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1354667&r1=1354666&r2=1354667&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java Wed Jun 27
18:54:58 2012
@@ -534,7 +534,8 @@ public class ApplicationContext
             String hostName = context.getParent().getName();
             try {
                 resources.lookup(normPath);
-                URI uri = new URI("jndi", getJNDIUri(hostName, fullPath), null);
+                URI uri = new URI("jndi", null, "", -1,
+                        getJNDIUri(hostName, fullPath), null, null);
                 return new URL(null, uri.toString(),
                         new DirContextURLStreamHandler(resources));
             } catch (NamingException e) {

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationContext.java?rev=1354667&r1=1354666&r2=1354667&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationContext.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationContext.java Wed Jun
27 18:54:58 2012
@@ -18,6 +18,8 @@ package org.apache.catalina.core;
 
 import java.io.File;
 
+import javax.servlet.http.HttpServletResponse;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -48,4 +50,23 @@ public class TestApplicationContext exte
             }
         }
     }
+
+
+    @Test
+    public void testBug53467() throws Exception {
+        Tomcat tomcat = getTomcatInstance();
+
+        File appDir = new File("test/webapp-3.0");
+        // app dir is relative to server home
+        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+        tomcat.start();
+
+        ByteChunk res = new ByteChunk();
+        int rc = getUrl("http://localhost:" + getPort() +
+                "/test/bug53467].jsp", res, null);
+
+        Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+        Assert.assertTrue(res.toString().contains("<p>OK</p>"));
+    }
 }

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=1354667&r1=1354666&r2=1354667&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Jun 27 18:54:58 2012
@@ -90,6 +90,11 @@
         Make the request available when establishing a WebSocket connection.
         (markt)
       </add>
+      <fix>
+        <bug>53467</bug>: Correct a regression in the fix for <bug>53257</bug>
+        that introduced problems for JSPs that used characters that must be
+        encoded if used in a URI. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message