What does the parameter in @RestController("/path/..")
do?
Does it not set the base path like @RequestMapping("/path/..")
.
What is the difference?
@RestController("base-path")
What does the parameter in @RestController("/path/..")
do?
Does it not set the base path like @RequestMapping("/path/..")
.
What is the difference?
@RestController("base-path")
Taken from the Spring Documentation:
@RestController
-@RequestMapping
-In case of
@RestController
the parameter value depicts the component name or bean name, whereas in@RequestMapping
the value parameter is used to specify the path. Both are used for different purpose.If you want to specify request URI path on controller class name use
@RequestMapping
annotation with@RestController
. Something like this: