How to specify path in META-INF/context.xml for Tomcat

前端 未结 4 1954
-上瘾入骨i
-上瘾入骨i 2021-02-05 14:05

I\'m using Tomcat 7 and would like to set the context root of a war file in the war file itself and have Tomcat autodeploy and pick up this path. I thought I found the way to

4条回答
  •  礼貌的吻别
    2021-02-05 14:50

    In /tomcat7/conf/server.xml add below lines inside the element and restart Tomcat to make changes take place.

    *change "mycom" to your application name.

    
      
      WEB-INF/web.xml
    
    
      
      WEB-INF/web.xml
    
    

    This will make the default root application appear under context root "/ROOT".

    Now your app is accessible at "/" and "/mycom" as well!

提交回复
热议问题