Summary: | crossContext for servlets not working | ||
---|---|---|---|
Product: | Tomcat 4 | Reporter: | J F <jfienberg> |
Component: | Servlet & JSP API | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED DUPLICATE | ||
Severity: | critical | CC: | chrigri, christian.wicke |
Priority: | P3 | ||
Version: | 4.0.4 Final | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | This a suggestion to fix Bug 10544 |
Description
J F
2002-07-08 05:18:32 UTC
I can confirm that this is also happening here. From a page in the root context ("/") it does not matter what you put in to getContext("/anyThingWillDo"), it always returns the current context (which is the roor context). I also found this problem in tomcat 4.0.6 and tomcat 4.1.12. Created attachment 4462 [details] This a suggestion to fix Bug 10544 Hello, I found the bug: src/share/org/apache/catalina/core/ApplicationContext.java line 445 (in tomcat 4.1.18): if ((contextPath.length() > 0) && (uri.startsWith(contextPath))) { return (this); } since the root context is "/" every uri starts with the contextPath and hence the root context is returned again. To fix it the 0 has to be replaced with 1. I attached a patch. Christian |