struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
 <constant name="struts.devMode" value="true" />
 <constant name="struts.action.extension" value="action,,jsp"></constant>
 <!--
 声明式异常处理
 -->
 <package name="default" extends="struts-default" abstract="true">
  <!-- 拦截器   -->
  <interceptors>
   <interceptor-stack name="checkLogin">
    <interceptor-ref name="filter"></interceptor-ref>
    <interceptor-ref name="defaultStack"></interceptor-ref>
   </interceptor-stack>
   <interceptor name="filter" class="org.ritraining.filter.AuthorityFilter"></interceptor>
  </interceptors>
  
  <!-- 拦截器   -->
  
  <global-results>
   <result name="error">/error.jsp</result>
   <result name="input">/index.jsp</result>
  </global-results>
  <global-exception-mappings>
   <exception-mapping result="error" exception="java.lang.Exception"></exception-mapping>
  </global-exception-mappings>
  
  
 </package>
 
 <package name="index" extends="default">
  <action name="index">
   <result>
    <param name="location">/index.jsp</param>
   </result>
  </action>
  <action name="User_login" class="UserAction" method="login">
   <result type="redirectAction">check/Emp_getEmps</result>
  </action>
 </package>

 <package name="check" namespace="/check" extends="default">
  <default-interceptor-ref name="checkLogin"></default-interceptor-ref>
  <action name="*_*" class="{1}Action" method="{2}">
   <result>/check/{1}_{2}_success.jsp</result>
  </action>
 </package>

</struts>   

你可能感兴趣的:(exception,struts,filter,Class,action,encoding)