struts1.3 DispatchAction 错误
配置文件:
<action
attribute="productForm"
input="/WEB-INF/adminjsp/updateProduct.jsp"
name="productForm"
parameter="method"
path="/product"
scope="request"
type="com.yourcompany.struts.action.ProductAction" />
action中的方法代码
public ActionForward showap(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String id=request.getParameter("id");
System.out.println("is getProduct() method!");
Products p=ps.getById(id);
request.setAttribute("p", p);
return mapping.findForward("showP");
}
jsp页面中的代码
<a href="product.do?method=showap&id=<%=p.getId() %>">test</a>