毕业设计问题之:DispatchAction的运用和其中的exccute+各种方法的运用
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>
--------------------------------------------------------------------------------------------------------