Bug 16258 - getContext does not work on default context
Summary: getContext does not work on default context
Status: RESOLVED DUPLICATE of bug 13040
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 4.1.12
Hardware: Other Linux
: P3 blocker (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-20 15:02 UTC by Detlef Huettemann
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***