How can I specify “Context path” on Tomcat 8 inside META-INF/context.xml in java war file?

后端 未结 3 561
轮回少年
轮回少年 2021-01-03 00:14

How can I deploy mywebapp-1.0.0.war to $TOMCAT_HOME/webapps directory with context path /mywebapp using context.xml inside the war file on

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 01:06

    It is not possible to put a war inside the webapp directory and set the path attribute in META-INF/context.xml file at the same time. Tomcat 8 documentation, clearly says about this attribute:

    This attribute must only be used when statically defining a Context in server.xml. In all other circumstances, the path will be inferred from the filenames used for either the .xml context file or the docBase.

提交回复
热议问题