user8204474
user8204474

Reputation:

Spring boot issue in loading the server.context path when application deployed in tomcat

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"
}
}
}

Upvotes: 1

Views: 1008

Answers (1)

Prasad
Prasad

Reputation: 1157

Use the below property

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

Upvotes: 1

Related Questions