Reputation: 822
I know how to set context path in WAR project. Create a context.xml file in META-INF folder and add the below lines
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/my-project-path"/>
But i don't know how to set in JAR projects without context.xml file. I had tried the following methods, but not working
1) server.servlet.context-path=/my-project-path in application.properties
2) System.setProperty("server.servlet.context-path", "/my-project-path");
server.servlet.context-path=/my-project-path is working in netbeans embeded Tomcat.
But not working in jboss/wildfly
Upvotes: 2
Views: 2486
Reputation: 6255
All of the server.* properties that Spring Boot supports only apply to the configuration of the embedded servlet container (Tomcat).
Jboss wildfly
Add your jboss-web.xml
file in this directory : /src/main/webapp/WEB-INF
Content:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/</context-root>
</jboss-web>
Upvotes: 4