全局异常的处理:

 1 <struts>
 2     <package name="struts" extends="struts-default">
 3     
 4         <global-results>
 5             <result name="nameempty">/nameempty.jsp</result>
 6         </global-results>
 7 
 8         <global-exception-mappings>
 9             <exception-mapping result="nameempty" exception="com.sunflower.exception.NameException"></exception-mapping>
10         </global-exception-mappings>
11 
12         <action name="loginvalidate" class="com.sunflower.action.LoginAction">
13             <result name="success">/welcome.jsp</result>
14             <!-- 如果输入信息的校验出错,则转回index.jsp -->
15             <result name="input">/index.jsp</result>
16         </action>
17     </package>
18 </struts>

相关文章:

  • 2022-01-13
  • 2022-12-23
  • 2021-11-26
  • 2021-11-21
  • 2022-12-23
  • 2022-03-04
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-25
  • 2021-10-12
  • 2021-09-09
  • 2021-12-05
  • 2021-07-17
  • 2021-11-24
相关资源
相似解决方案