struts2.0的全局跳轉(zhuǎn)
<global-results>
<result name=”ok”>/ok.jsp</result>
</global-results>
struts2.0的局部跳轉(zhuǎn):
<action name=”login” class=”dd.login”>
<result name=”ok”>/ok.jsp</result>
</action>
全局異常:
<global-exception-mappings>
<exception-mapping result=”error” exception=”java.lang.Exception”/>
</global-exception-mappings>
要在<global-results>
<result name="error">/error.jsp</result>
</global-results>
在action中指明該action處理的方法:
<action name=”login” class=”xxx.loginAction” method=”login”>
<result name=”ok”>/ok.jsp</result>
</action>
-------------------------------------------------
從action1直接跳轉(zhuǎn)到action2,有兩種方法:
1. 需要保存前一個action的屬性信息時使用:
<result type= "chain ">action2</result>
2. 不保存前一個action的參數(shù)可以用這種方法:
<result type= "redirect-action "> ActionName </result>
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點擊舉報。