Announcement Announcement Module
Collapse
No announcement yet.
Issue in RESTful URL with Special Characters Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue in RESTful URL with Special Characters

    Hi,

    I'm using Spring 3.3 RESTful services. When I get the '/' character in the URL path values, the controller considers it as a new path separater.

    Eg: accounts/orders/{id}. The value for id is AS5547/54/5.

    The controller searches for the path accounts/orders/AS5547/54/5 and failes.
    But the actual URL is accounts/orders/ only.

    Code:

    @RequestMapping(value = accounts/orders/{id}", method = RequestMethod.GET )
    public ModelAndView getOrders(@PathVariable ("id")
    String id )
    {......}

    1. Is there a way to pass the '/' character as part of the value in the URL?
    2. Is there a way to pass the '.' character as part of the value in the URL? (values sent after the . are discarded (45.03 gives 45 only)

    Any help is much appreciated.

    Thanks,
    Vaithi

  • #2
    get 404 when URL contains forward slash in string

    Have anyone know how to resolved the problem that Vaithi describing in post 1.
    Thanks in advance


    I got the same issue when trying to using Spring3 M2 with REST approach
    @RequestMapping(value="/something/{searchString}", method=RequestMethod.GET
    public String doSearch(@PathVariable("searchString") String searchString) {



    }

    URI generate http://localhost:8080/something/xyz/abc ---> "xyz/abc" is the whole string which contain the slash

    Comment

    Working...
    X