Generally we can get in the controller the posted values of the fields from JSP like this :
@Controller
public class someClass {
@RequestMapping(value = "/someUrl", method = RequestMethod.POST)
public ModelAndView someMethodName(@RequestParam Map<String, String> params) {
for (Map.Entry<String, String> param : params.entrySet()) {
// field name is got from param.getKey() , field value is got from param.getValue()
}
return new ModelAndView("redirect:/someOtherUrl");
}
}
The problem occurs if a field is a select element which is multiple. So how to get the values selected from it ?