一个小问题,struts2超链接
struts2使用超链接传递参数给action类!
JSP超链接部分:
<li> <s2:url id="url" action="p_getProductsByBrandName"> <s2:param name="temp">参数</s2:param> </s2:url> <s2:a href="%{url}">华硕</s2:a> </li> // get products by brand's name public String getProductsByBrandName() { HttpServletRequest request=(HttpServletRequest)ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST); String name=request.getParameter("temp"); // name=null ???? return SUCCESS; } }/-- Encapsulated exception ------------\java.lang.NoSuchMethodException: vo.Test.setTemp([Ljava.lang.String;)