随笔-208  评论-469  文章-30  trackbacks-0
  DispatchAction 必须不写execute(... ...)方法,
否则反而有问题, 使用中我发现如果你写了exceute 方法 struts仍然首先调用改excute()方法,
这是即使你配置了 method 参数如 action="abcAction.do?method=load" 也无效,
 struts 仍然首先执行execute, 故DispatchAction中不要写execute( ... ...) 方法.

----------------------------方法都要象下面一样写------------------------------------------------------------
 public ActionForward  delete(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response){
  System.out.println("this is delete! ");
  return mapping.findForward("pageInfo");
 }
--------------------------struts-config.xml里的写法(我没有写form)--------------------------------------------------------
    <action
      path="/displayAll"
      input="/resultDb/pageInfo.jsp"
      type="ctm.struts.action.DisplayAllAction"
      parameter="method"  //要注意
      scope="request"
      validate="false" >
      </action>
--------------------------------------------------------------------------------------------------------
posted on 2007-04-04 14:36 EricWong 阅读(296) 评论(0)  编辑  收藏 所属分类: Java

只有注册用户登录后才能发表评论。


网站导航: