Results 1 to 6 of 6

Thread: spring mvc: what's the correct way to set up a URI template like "/a/b/{c}"

  1. #1
    Join Date
    Nov 2010
    Posts
    9

    Default spring mvc: what's the correct way to set up a URI template like "/a/b/{c}"

    I can get a URI template in the form of "/a/b" or "/a/{b}" to work. But when I try "/a/b/{c}", I get a HTTP 404 and a message in the log in the form of "No mapping found for HTTP request with URI [/myapp/a/b/c]..."

    I noticed all the examples in section 15.3.2.1 show URI templates in the form of "/a/{b}" or /a/{b}/c/{d}". So is "/a/b/{c}" not possible? Is there anything I need to set in web.xml to make this happen? Or can some configuration prevent that pattern from being mapped?

  2. #2
    Join Date
    Nov 2010
    Posts
    7

    Default I have the same problem !

    All I get is HTTP 404. I went by the documentation and surprised to see it is this difficult to get something apprently very simple according to the documentation !.

  3. #3
    Join Date
    Nov 2010
    Posts
    9

    Default

    I fixed my problem. I had the ControllerClassNameHandlerMapping enabled and apparently that handler only maps one level down:/a/b.

    I removed that and use DefaultAnnotationHandlerMapping and now things work fine. Details here:
    http://stackoverflow.com/questions/4...-form-of-a-b-c

  4. #4
    Join Date
    Nov 2010
    Posts
    7

    Default Still No Luck

    Mine is even simpler. I just need to get to one level, like http://localhost:7001/myapp/search/ABC. By the way, I'm using WebLogic - is that matter ?

  5. #5
    Join Date
    Nov 2010
    Posts
    9

    Default

    Quote Originally Posted by athaudan View Post
    Mine is even simpler. I just need to get to one level, like http://localhost:7001/myapp/search/ABC. By the way, I'm using WebLogic - is that matter ?
    I'm new to all this so hopefully someone else can answer. Try StackOverflow as well.

  6. #6
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    It helps to look at our samples like mvc-showcase.

    Keith
    Keith Donald
    Core Spring Development Team

Posting Permissions

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