开发者

Short url or alias for deployed application in tomcat 6

开发者 https://www.devze.com 2023-01-24 14:31 出处:网络
I have a web application project which is deployed in tomcat 6. I can access my application using the url:

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 c开发者_开发问答hange the original name of the application('MyApplication').

Thanks, Abhishek.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消