I want to pass array as path parameter in URL.
My code is as follows:
Controller:
@RequestMapping(value = "/getAllProcessInstancesByLocation/[{location_id}]" , method = RequestMethod.GET)
public String getAllProcessInstances(@PathVariable("location_id") String[] location_id) {
try {
return processService.getAllProcessInstancesByLocation(location_id);
}catch(Exception e) {
return "error=>"+e.getMessage();
}
}
When I try to test this through browser I am getting following error:
http://localhost:8088/super-admin/getAllProcessInstancesByLocation/[%7B8,9%7D]
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Jul 11 12:54:55 IST 2018 There was an unexpected error (type=Internal Server Error, status=500). Could not get HttpServletRequest URI: Illegal character in path at index 67: http://localhost:8088/super-admin/getAllProcessInstancesByLocation/[%7B8,9%7D]
How to pass the array in url? I want to pass as follows:
http://localhost:8088/super-admin/getAllProcessInstancesByLocation/[7,9,11]