java - Spring Boot .war context path for Undertow and Tomcat -


i have spring boot application deploy .war file in existing tomcat , undertow(wildfly) containers. how can configure context path within application?

i know can use .war name directly, dont want since .war name contains version information etc.

from tomcat configuration docs defining context:

individual context elements may explicitly defined:

  • in individual file @ /meta-inf/context.xml inside application files. optionally (based on host's copyxml attribute) may copied $catalina_base/conf/[enginename]/[hostname]/ , renamed to
    application's base file name plus ".xml" extension.
  • ...

also note:

if want deploy war file or directory using context path not related base file name 1 of following options must used prevent double-deployment:

  • disable autodeploy , deployonstartup , define contexts in server.xml
  • locate war and/or directory outside of host's appbase , use context.xml file docbase attribute define it.

also along lines of looking how set context path of web application in tomcat 7.0

for undertow, if it's used web server in wildfly try jboss-web.xml like: https://stackoverflow.com/a/28475123/4807777


Comments