How to not decode the string set by @RequestParam in Spring Boot?

Viewed 5992

My controller has a method like below:

@ResponseBody
public String test(@RequestParam("r") String r){
String requestURI = request.getQueryString();
// What I want: abc+def%2Cfjg
System.out.println(requestURI.split("=")[1]);
// This is not what I want: abc def,fjg
System.out.println(r);
}

How can I let Spring boot know that the RequestParameter must not be decoded? i.e not converting + to space, %2C to comma etc..

1 Answers
Related