Results 1 to 2 of 2

Thread: Problems after @PathVariable parameter value containing the '/' character

Hybrid View

  1. #1

    Default Problems after @PathVariable parameter value containing the '/' character

    Hi,all:
    I have a use case. Spring MVC REST Url receive content using the GET method code is as follows:
    Code:
    @RequestMapping("/q/{key}")
    public String query(@PathVariable() String key, Model model){
        //todo
    }
    But the front end of such a request :"/q/SiGeC%2FSi%E5%BC%82%E8%B4%A8%E7%BB%93". '%2F' decoded character '/'. The controller can not match mapping request. How should I do?

    by Howsun.
    Thanks!
    What is the snow melt? Not water, also do not think that it is spring. In Beijing, the snow is melting the ice

  2. #2

    Default

    Annotations of @ PathVariable may not be able to solve this problem.Last use the workaround is resolved.Code is as follows:
    Code:
    @RequestMapping("/q/**")
    What is the snow melt? Not water, also do not think that it is spring. In Beijing, the snow is melting the ice

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
  •