I want to pass a parameter from my jsp page to the controller. I found a way to do this, on click -
<a href="ReqElement/reqTypeList.html?menuTab=CRM Setup">CRM Setup</a>
and in the controller class -
@RequestMapping("/reqTypeList")
public ModelAndView reqTypes(@ModelAttribute("reqElementSetup") ReqElementBean reqElBean, BindingResult result, Map<String, Object> map,HttpSession session,@RequestParam("id") String menu) {
But if I want to pass a few parameters, then I need to add another @RequestParam as -
@RequestMapping("/reqTypeList")
public ModelAndView reqTypes(@ModelAttribute("reqElementSetup") ReqElementBean reqElBean, BindingResult result, Map<String, Object> map,HttpSession session,@RequestParam("id") String id,@RequestParam("roleId") String roleid,@RequestParam("funcId") String funcid) {
So my question is: is there any other convenient way to do this? Because in this way, in this way, that is, in the case of an increasing number of parameters, the size of the method parameter will be increased. I am new to Spring. Please, help.
source
share