I want to be able to define a parent Controller class which will have a mapping of "/api", and then extend that controller with my different implementations. So ApiController will have:
@Controller
@RequestMapping("/api")
For example, my User controller should extend the base api controller and also add "/users" to the path, so it will answer to "/api/users" requests. So UserController will have:
@Controller
@RequestMapping("/users")
but since it extends ApiController, it will effectively answer to /api/users.
Naturally I can prepend "/api" to all controllers so that this is achieved without the parent class, but I prefer to do it "the right way" if it's possible, so that I can define my api implementations with a cleaner and more visible path.
I tried extending the ApiController base class, but this does not work, UserController still answers to "/users" and ignores the base class "/api".