Results 1 to 3 of 3

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

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    37

    Default 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. #2
    Join Date
    Sep 2008
    Posts
    7

    Default

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

  3. #3
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    37

    Default

    Thanks, voted.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •