How to set context path in Spring Boot for Tomcat

Share this

There are three ways to set context path in the spring boot application.

Scenario 1

If you are using a standalone Tomcat server instance, it doesn’t allow you to use the following property:

server.servlet.context

Refer to the below URL:

https://stackoverflow.com/a/43856300/1936319 

Scenario 2

For detailed steps on how to deploy a spring boot war into the Tomcat server, check out this URL:

https://www.baeldung.com/spring-boot-war-tomcat-deploy  

Scenario 3

If you are using the embedded Tomcat server, refer to the below link to set your server context path using server.servlet.context-path for spring boot 2:

https://www.baeldung.com/spring-boot-context-path 

Are you still facing issues even after trying the above ways? Drop in a comment and we will look into it. Thanks for checking out this blog!!

Share this

Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “How to set context path in Spring Boot for Tomcat”