tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: ServletContext.getContext() always returns when calling from "root" context (even with crossContext)
Date Fri, 28 Aug 2009 18:48:05 GMT
invalid path

path="/ "

try

path=""


On 08/28/2009 02:57 AM, Jan Jonas wrote:
> I have a very annoying problem with tomcat 6:
>
> ServletContext.getContext() always returns null if I call the method from the "root"
context, i.e. the context I have defined with path="/" in my server.xml. I also tried setting
path="" (I read that this could fix problems in tomcat 5 - I'm using tomcat6 but a thought
it might help).
>
> Here are the context definitions of my server.xml:
>
>                  <Context path="/context2" docBase="/absolute/path/to/a/folder/" />
>                  <Context path="/ " docBase="..." crossContext="true" reloadable="true"/>
>
> I also tried defining both contexts with crossContext="true". If a change the path from
the second context to something else than "/" or "" everything works fine. Is this a tomcat
bug?
>
> My workaround now is to use apache's mod_rewrite to handle requests on "/".
>
> Regards
>    Jan
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message