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

http://issues.apache.org/bugzilla/show_bug.cgi?id=27925

getContext() fails for xml-specified contexts

           Summary: getContext() fails for xml-specified contexts
           Product: Tomcat 5
           Version: 5.0.19
          Platform: Other
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If you run with crosscontext enabled:

<%

javax.servlet.ServletContext context =
pageContext.getServletContext().getContext("/jsp-examples/cal/");

if (null!= context)
{
        out.print(context.getRealPath("/"));
}
%>


Fine, result is: 

D:\java\jakarta-tomcat-5.0.19\webapps\jsp-examples\


If you call getContext("/anothercontext");

it still works if /anothercontext is included with a context.xml file in 
D:\java\jakarta-tomcat-5.0.19\conf\Catalina\localhost


But getContext("/anothercontext/") i.e. the slash or any existing path appended

results in D:\java\jakarta-tomcat-5.0.19\webapps\ROOT\

It seems the context-lookup algorithm checks only the part specified with 
<Context path="/anothercontext" in the xml file.

But getContext() should find a context, regardless how the context is made known
to the container.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to