浏览 3772 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-06-30
struts1.2.4中要把 Action中的perform()方法改成execute()方法 如:public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)throws Exception package book; import javax.servlet.http.*; import org.apache.struts.action.*; public final class BookAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)throws Exception { System.out.println("Start perform("+form+")......"); String title=req.getParameter("title"); Book book=new Book(); book.setTitle(title); System.out.println("After creation of book:"+book.getTitle()); req.setAttribute("BOOK",book); return mapping.findForward("bookCreated"); } } 二.Struts配置文件是缺少plug-in配置 如validator的配置 三.资源文件找不到 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |