tags:

views:

45

answers:

2

Is there anyway of configuring tomcat to point more than one context at a webapp?

I need to point these two urls:

http://server.com/abc
http://server.com/def

to a webapp running under the context abc.

+1  A: 

If your requirement is for a production app, I would recommend having an Apache Web Server before the tomcat so that you can do this and more.

Script Runner
Thanks, but unfortunately this isn't a possibility for us.
Scobal
Have you checked Virtual Hosting with Tomcat : http://www.ex-parrot.com/pete/tomcat-vhost.html
Script Runner
That looks promising... Can you give me an example usage with my scenario? It looks more like many urls to many contexts to me :s
Scobal
+3  A: 

Tomcat does not allow direct configuring of multiple <Context> elements to point to the same path.

So your options are either deploying the same web app twice with different Context (Not great idea)

or create a webapp called def that has one custom servlet filter declared in the web.xml that re-writes all requests to abc.

JoseK