1
votes

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"
}
}
}
1
There is no issue, work as designed. The server.* properties only apply when you are running standalone NOT when deployed into a container. - M. Deinum
Is there any way to do that - user8204474
Configure your tomcat accordingly. - M. Deinum
Is there any configuration component in spring boot to do that..Like the way we used to do in web.xml - user8204474

1 Answers

1
votes

Use the below property

                      spring.data.rest.basePath=/v1.0