I have multiple REST controllers and would like all the url's to have "/rest" as the common url pattern.
E.g. (1) UserController: http://localhost:9000/rest/user (2) TicketController: http://localhost:9000/rest/ticket
Is there a way i can achieve this?
I tried:
@RequestMapping(value="/rest")
public abstract class BaseController { }
@RestController
@RequestMapping(value="/ticket")
public class TicketController extends BaseController{
@RequestMapping(method=RequestMethod.POST)
public Ticket createTicket(@RequestBody Ticket ticket){
return ticketService.createTicket(ticket);
}
}