I want to get the name and value of a URL parameter using RequestMapping.
For instance, if I pass in the URL http://localhost:8080/assignment2/trafficcameras?ip_comm_status=bad
I want to isolate the name of the parameter as "ip_comm_status".
And the value of the parameter as "bad".
How would I access the name and value of any parameter pair?
The problem is that I know how to get the value but not the name of a parameter.
ip_comm_status and camera_status are my valid parameter names.
So far I have:
@ResponseBody
@RequestMapping(value = "/trafficcameras", params = {"ip_comm_status", "camera_status"}, method = RequestMethod.GET)
public String parseParams(@RequestParam(value = "ip_comm_status", required = false) String ip_comm_status_val,
@RequestParam(value = "camera_status", required = false) String camera_status_val) {
}