How to set the context path of a web application in Tomcat 7.0

后端 未结 13 1514
傲寒
傲寒 2020-11-21 23:34

I know that I can rename my webapp (or it\'s WAR file) to ROOT but this is a terrible way to do it, IMHO. Now I checked out the tomcat doc & it says

13条回答
  •  野性不改
    2020-11-21 23:49

    In Tomcat 8.X ,under tomcat home directory /conf/ folder in server.xml you can add tag under tag as shown below . But you have to restart the server in order to take effect

      
    
         
      
    

    OR if you are using Tomcat 7.X you can add context.xml file in WEB-INF folder in your project . The contents of the file i used is as shown . and it worked fine for me . you don't have to restart server in this case .

    
    
    
    

提交回复
热议问题