You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/03/25 00:10:56 UTC
DO NOT REPLY [Bug 27925] New: -
getContext() fails for xml-specified contexts
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: tomcat-dev@jakarta.apache.org
ReportedBy: juergen@jwi.de
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org