I am not able to reference resources from one webapp to another in the same host. I have previously successfully used the configuration (in 4.03): <DefaultContext crossContext="true"/> I also tried adding crossContext="true" to the contexts for each webapp in the host. This made no change. The following (from a page in the ROOT context) gets a 404 error and the host log shows the error is for the URI /test.jsp (root cause: java.io.FileNotFoundException: /test.jsp), where it previously successfully forwarded to the page /webapp2/test.jsp: RequestDispatcher dispatcher = ctx.getContext ("/webapp2").getRequestDispatcher("/test.jsp"); dispatcher.forward(request, response); For any value I use in ctx.getContext("/asdas") that begins with a "/", I get the current context (non-null), EVEN if the value does not match any existing context.
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
*** This bug has been marked as a duplicate of 13040 ***