Announcement Announcement Module
Collapse
No announcement yet.
Request path doesn't match. Why is it more specific? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Request path doesn't match. Why is it more specific?

    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.

    Code:
    /api/board/1
    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!

  • #2
    This is why: https://jira.springsource.org/browse/SPR-8355 . Vote for it if it's bothering you as much as us...

    Comment


    • #3
      Thanks, voted.

      Comment

      Working...
      X