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>
<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>
...全文
相关推荐
struts_dispacthaction_usermgr
博文链接:https://shaqiang32.iteye.com/blog/201332
Struts Struts1例子Struts注意事项
NULL 博文链接:https://pouyang.iteye.com/blog/637567
struts_02源代码
全国最有名的java工程师培训机构的源代码,价值连城,学struts就是这么简单!结合struts参考书看事半功倍。分享!
struts 1的标签的用法详细
struts 1的标签的用法详细使用于初学者
Struts+Hibernate的高级功能
关于Struts和Hibernate的讲解、我看过的、还挺不错的。


Web 开发
