DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13040>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13040

can't retrieve external context who's uri is a sub-dir of current context





------- Additional Comments From [EMAIL PROTECTED]  2002-10-23 13:18 -------
Agreed, we need to add "/" to the end, but that goes for the incoming URI as 
well. We also need to treat the ROOT context differently. I agree the specs 
are bad, but we need to solve this with what we got, since the getContext() 
method as it currently stands isn't useful.

-----------------------------------------------------------
--- ApplicationContext.java-2002-10-21  Mon Sep 23 11:23:16 2002
+++ ApplicationContext.java     Wed Oct 23 14:08:41 2002
@@ -439,12 +439,25 @@
             return (null);

         // Return the current context if requested
-        String contextPath = context.getPath();
-        if (!contextPath.endsWith("/"))
-            contextPath = contextPath + "/";
-        if ((contextPath.length() > 0) && (uri.startsWith(contextPath))) {
-            return (this);
-        }
+       String contextPath = context.getPath();
+       if ( contextPath.equals( "" ) ) {
+         if ( uri.equals( "/" ) ) {
+           return (this);
+         }
+       } else {
+         String compareUri = uri;
+         if ( !uri.endsWith( "/" ) ) {
+           compareUri = compareUri+"/";
+         }
+         if ( !contextPath.endsWith( "/" ) ) {
+           contextPath = contextPath+"/";
+         }
+         if ( compareUri.startsWith( contextPath ) ) {
+           return (this);
+         }
+       }
+
+       System.out.println( context.getCrossContext() );

         // Return other contexts only if allowed
         if (!context.getCrossContext())
-----------------------------------------------------------

Martin Algesten

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>

Reply via email to