Define Servlet Context in WAR-File

前端 未结 4 526
执笔经年
执笔经年 2020-12-05 03:15

How can I tell e.g. Tomcat to use a specific context path when given my WAR-File?

Example: I have a war file created by maven build and the resulting name of the fil

4条回答
  •  长情又很酷
    2020-12-05 03:19

    I found an easy solution to keep war file name and choose the context-path.

    You just have to deploy your war outside of the Host's appBase and to create a link inside the appBase directory.

    Ex. :

    ln -sf ${CATALINA_HOME}/wars/myapp-0.0.8-SNAPSHOT.war ${CATALINA_HOME}/webapps/myapp.war
    

    Ektor

提交回复
热议问题