Short url or alias for deployed application in tomcat 6
Asked Answered
U

1

5

I have a web application project which is deployed in tomcat 6. I can access my application using the url:

http://localhost:8082/MyApplication

I also wan't to be able to access this application by another url like: http://localhost:8082/myapp

Is this possible ? if yes what alternatives do i have ?

Off course, I don't want to change the original name of the application('MyApplication').

Thanks, Abhishek.

Umbilication answered 10/11, 2010 at 11:52 Comment(0)
P
7

If you add the Context within server.xml it will work as you want. Give the path attribute you wish.

<Context docBase="MyApplication" path="/myapp" /> 

Though it works, this approach is not recommended by the Tomcat docs, since any changes to server.xml means restarting the server disturbing all the web apps.

But, on the flip side, the practice of keeping this in Catalina_Home/conf/Catalina/localhost/context.xml (which is recommended by the docs) has some unreliabilities as others have reported - when you redeploy the war you can lose the context.xml too

See Why-does-tomcat-replace-context-xml-on-redeploy and Why does tomcat like deleting my context.xml file?

Plasterwork answered 10/11, 2010 at 11:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.