@Controller no longer using spring.data.rest.base-path variable for REST URL for @RequestMapping -


i created @restcontroller @entity objects rest url being set correctly using spring.data.rest.base-path variable set in application.peroperties /api @requestmapping("someendpoint") not using variable.

example

for @entity class user rest endpoint located at:

`http://localhost:8081/api/users' 

but when try access someendpoint:

'http://localhost:8081/api/someendpoint' 

i response of:

response status

http/1.1 404 not found 

body

"timestamp":1461267817272,"status":404,"error":"not found","message":"no message available","path":"/api/someendpoint"} 

instead endpoint of rest service located @

'http://localhost:8081/someendpoint' 

response:

http/1.1 200 ok 

controller class

@restcontroller public class homecontroller {      @requestmapping(value = "/")     public string index() {         return "index";     }      @requestmapping("someendpoint")     public stuff runsomething(             @requestparam(value = "id", required = true) string id) 

what missing in configuration?

thank you

spring.data.rest.base-path spring data rest, expose repository outside rest hateoas not spring context.

what want server.context-path spring mvc stuff.

check here full properties.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -