You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Jain <Er...@isb-sib.ch> on 2006/11/16 19:17:21 UTC

Get non-ROOT applications to return "" for getContextPath?

Is it possible to trick an application into believing that it is the ROOT 
application (i.e. getContextPath returns ""), even when it isn't?

The reason for this is that managing virtual hosts with Tomcat can be a bit 
cumbersome, and some management applications won't work in such a setup.

The requests in our setup all pass through Apache, so I would prefer to 
just tell mod_proxy to serve content from specific subdirectories on the 
Tomcat server rather than having to duplicate the entire virtual host 
configuration. The only problem with this is that generated links are 
broken as the point to /subdir/* instead of /*.

Suggestions?

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


Re: Get non-ROOT applications to return "" for getContextPath?

Posted by David Smith <dn...@cornell.edu>.
You could implement a filter that passes on a request wrapper.  Then
just override the getContextPath() method to return "".

Eric Jain wrote:

> Is it possible to trick an application into believing that it is the
> ROOT application (i.e. getContextPath returns ""), even when it isn't?
>
> The reason for this is that managing virtual hosts with Tomcat can be
> a bit cumbersome, and some management applications won't work in such
> a setup.
>
> The requests in our setup all pass through Apache, so I would prefer
> to just tell mod_proxy to serve content from specific subdirectories
> on the Tomcat server rather than having to duplicate the entire
> virtual host configuration. The only problem with this is that
> generated links are broken as the point to /subdir/* instead of /*.
>
> Suggestions?
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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