开发者

Passing JSP parameters to spring controller

开发者 https://www.devze.com 2023-03-26 06:44 出处:网络
I am having issues with passing values between jsp to controller.. my home.jsp includes another file check.jsp..

I am having issues with passing values between jsp to controller..

my home.jsp includes another file check.jsp..

<jsp:include page="check.html" flush="true">
    <jsp:param name="param1" value="1" />
    <jsp:param name="param2" value="expert" />
    <jsp:param name="param3" value="skill"/>
</jsp:include>

and here is the controller...

@RequestMapping(value="check", method = RequestMethod.GET)
public String checkList(ModelMap modelMap, HttpServletRequest request){
    Map<String, String> map = new HashMap<String, String>();
    map.put("param1",request.getParameter("param1"));
    map.put("param2",request.getParameter("param2"));
    map.put("param3",request.getParameter("param3"));
    modelMap.addAllAttributes开发者_开发问答(map);
    return "checklist";
}

but I can't get the values in controller.. I mean all param values are null in the controller.. How to get these values?


  1. check != check.html
  2. include != GET

That's why your params are empty.

0

精彩评论

暂无评论...
验证码 换一张
取 消