tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1345357 - /tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
Date Fri, 01 Jun 2012 21:33:19 GMT
Author: kkolinko
Date: Fri Jun  1 21:33:19 2012
New Revision: 1345357

URL: http://svn.apache.org/viewvc?rev=1345357&view=rev
Log:
For https://issues.apache.org/bugzilla/show_bug.cgi?id=53257
Review of r1344902:
Restore passing DirContextURLStreamHandler instance into the new URL.

Note that we use "new DirContextURLStreamHandler(DirContext)" and
thus the handler will not need to call DirContextURLStreamHandler#get() to retrieve the context.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1345357&r1=1345356&r2=1345357&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Fri Jun  1 21:33:19
2012
@@ -67,6 +67,7 @@ import org.apache.catalina.connector.Con
 import org.apache.catalina.deploy.FilterDef;
 import org.apache.catalina.util.ResourceSet;
 import org.apache.catalina.util.ServerInfo;
+import org.apache.naming.resources.DirContextURLStreamHandler;
 import org.apache.naming.resources.Resource;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.CharChunk;
@@ -517,8 +518,9 @@ public class ApplicationContext
             String hostName = context.getParent().getName();
             try {
                 resources.lookup(normPath);
-                return new URI("jndi",
-                        getJNDIUri(hostName, fullPath), null).toURL();
+                URI uri = new URI("jndi", getJNDIUri(hostName, fullPath), null);
+                return new URL(null, uri.toString(),
+                        new DirContextURLStreamHandler(resources));
             } catch (NamingException e) {
                 // Ignore
             } catch (Exception e) {



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


Mime
View raw message