I am trying to map URL with pipe separated parameters and unable to map in controller class with @RequestMapping("/service").
Example : Request url : http://localhost:8080/service?name=raj|mahesh|akshay|abhi
It is accepting when I tried with one name i.e. raj but throwing an exception when I tried with multiple name with pipe deliminator.
@RestController
class Employee {
@RequestMapping("/service", , method = RequestMethod.GET)
public String getNameService(@RequestParam(value="name", required=false) String name) throws Exception {
.....
System.out.println(name);
}
}
Exception :
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
How to get all values of param name ?