You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stanley Yue <st...@gmail.com> on 2006/12/09 07:31:57 UTC

How to configure multiple context path for a webapps

Hi all:

I have one webapps named "webapp1", with context path "/webapp1". This
webapps has one servlet with name "TestServlet".

I want to be able to access this servlet through the following urls:
http://host/webapp1/TestServlet, and
http://host/r/TestServlet

Is it possible to configure "webapp1" to have multiple context path? I.e.
"/webapp1" and "r"? I want to be able to do this without relying on server
side forwarding (i.e. implementing a webapps called "r" that forwards to
"webapp1").

Thanks,

Stanley

Re: How to configure multiple context path for a webapps

Posted by Leon Rosenberg <ro...@googlemail.com>.
The easiest way is to define a context.xml for r which specifies
webapp1 as doc-root. However this will have the drawback, that the
same webapp will be loaded twice under difference contexts.

Other ways are defining ROOT context, per filter forwarding, proxying and so on

regards
Leon

On 12/9/06, Stanley Yue <st...@gmail.com> wrote:
> Hi all:
>
> I have one webapps named "webapp1", with context path "/webapp1". This
> webapps has one servlet with name "TestServlet".
>
> I want to be able to access this servlet through the following urls:
> http://host/webapp1/TestServlet, and
> http://host/r/TestServlet
>
> Is it possible to configure "webapp1" to have multiple context path? I.e.
> "/webapp1" and "r"? I want to be able to do this without relying on server
> side forwarding (i.e. implementing a webapps called "r" that forwards to
> "webapp1").
>
> Thanks,
>
> Stanley
>
>

---------------------------------------------------------------------
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