1

I am facing issue with spring boot.When I run spring boot as standalone application it is considering the server.context-path. But when i deploy same application in tomcat container(not the default in spring boot) it is not considering the server.context-path and loads the application in root context.

http://localhost:8080/book-service/(deployed on tomcat)

{
   "_links" : {
"users" : {
  "href" : "http://localhost:8080/book-service/users{?page,size,sort}",
  "templated" : true
},
"profile" : {
  "href" : "http://localhost:8080/book-service/profile"
}
 }
}

http://localhost:9001/v1.0/(running as spring boot application it is considering the context path(v1.0)

{
"_links" : {
"users" : {
  "href" : "http://localhost:9001/v1.0/users{?page,size,sort}",
  "templated" : true
},
"profile" : {
  "href" : "http://localhost:9001/v1.0/profile"
}
}
}
4
  • There is no issue, work as designed. The server.* properties only apply when you are running standalone NOT when deployed into a container. Commented Sep 19, 2017 at 6:08
  • Is there any way to do that Commented Sep 19, 2017 at 6:22
  • Configure your tomcat accordingly. Commented Sep 19, 2017 at 6:22
  • Is there any configuration component in spring boot to do that..Like the way we used to do in web.xml Commented Sep 19, 2017 at 6:39

1 Answer 1

1

Use the below property

                      spring.data.rest.basePath=/v1.0
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.