Bug 16258

Summary: getContext does not work on default context
Product: Tomcat 4 Reporter: Detlef Huettemann <huettemann>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 4.1.12   
Target Milestone: ---   
Hardware: Other   
OS: Linux   

Description Detlef Huettemann 2003-01-20 15:02:09 UTC
Having several contexts declared in a <host> entry, the default context
( <context name=""> .. </context> )
does not give access to other contexts declared in that host entry:
myContext.Context("/other") will always return myContext.

server.xml code snippet:

<host name="myhost.mydomain">
    <Context path="" docBase="/myWebapps/test" crossContext="true" />
    <Context path="other" docBase="/myWebapps/other" crossContext="true" />
</host>

/myWebapps/test/index.jsp:
my context: <%= getServletContext() %>
other context: <%= getServletContext().getContext("/other")
Comment 1 Remy Maucherat 2003-01-20 15:05:01 UTC
Try to do a query before filing a bug, as well as assign sensible severity level.

*** This bug has been marked as a duplicate of 13040 ***