Hi, I have a controller like this
Code:
@Controller
@RequestMapping("/api")
public class ApiController {
@RequestMapping(value = "/board/{boardId}", method = RequestMethod.GET)
@RequestMapping(value = "/board/{boardId}/entries/{limit}/{offset}", method = RequestMethod.GET)
@RequestMapping("/**")
}
The meaning of the last RequestMapping is to have a "catch-all" handler, so that if no /api/** path match a defined one, I will get in that "deafult" handler.
gets correctly dispatched.
Code:
/api/board/1/entries/20/0
instead, goes in the "default" handler.
I'm aware that I can configure a defaultHandler property in the HandlerMapping, but still I would like to know why Spring thinks that /** is more specific than /api/board/{boardId}/entries/{limit}/{offset}
Thanks a lot!