tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smith, Ryan" <rsm...@soe.sony.com>
Subject Unable to Retrieve another Context from within the "root" context (by design, or bug?)
Date Tue, 24 Sep 2002 23:35:10 GMT
I'm wondering if this was by design or if it's a bug.  Running Tomcat 4.1.10
 
I am unable to retrieve the context of another webapp from within the root
context.
 
I've got two contexts setup, one with path="/common", and another with
path="".  From within the context with path="", there is a jsp which
attempts to retrieve the path="/common" context:
 
        servletContext.getContext("/common");
 
Unfortunately, in the
org.apache.catalina.core.ApplicationContext.getContext(String uri) method,
the code always returns the current context whenever the uri passed contains
as it's prefix the path of the current context (context.getPath()).
 
So, given that the root contexts path="", it gets a "/" appended to it, and
that new string is will *always* be the prefix of any uri that is passed
into the getContext(String uri) method, there is no way to ever retrieve a
context for another app from within the root context.
 
So my question is, is that by design, or is it a bug?
 
Thanks,
 
-Ryan
 
---------------------------------------
Ryan Smith
Platform Engineer
Sony Online Entertainment
(858) 577-3072
rsmith@soe.sony.com <mailto:rsmith@soe.sony.com> 
---------------------------------------
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message