I\'m trying to to mix mvc and rest in a single spring boot project.
I want to set base path for all rest controllers (eg. example.com/api) in a single place (I don\'
You can create a custom annotation for your controllers:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@RestController
@RequestMapping("/test")
public @interface MyRestController {
}
Use it instead of the usual @RestController on your controller classes and annotate methods with @RequestMapping.
Just tested - works in Spring 4.2!