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>
<!-- 是否开启动态方法,动态方法调用格式actionName!methodName.action,不推荐该方式 -->
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<!-- 开发模式下使用可以打印出详细的错误信息 -->
<constant name="struts.devMode" value="false" />
<!-- 指定编码集 -->
<constant name="struuts.i18n.encoding" value="UTF-8"></constant>
<!-- 指定使用国际化资源struts2 -->
<constant name="struts.custom.i18n.resources" value="donglusoft"></constant>
<!-- 指定浏览器是否缓存静态内容 -->
<constant name="struts.serve.static.browserCache" value="false"></constant>
<!-- 指定struts配置文件修改后是否自动重新加载文件 -->
<constant name="struts.configuration.xml.reload" value="true"></constant>
<!-- 与spring集成,指定由spring负责action的创建 -->
<constant name="struts.objectFactory" value="spring"></constant>
<!-- 上传文件的大小限制 -->
<constant name="struts.multipart.maxSize" value="5048576"></constant>
<!-- 启动静态方法的访问 -->
<constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant>

<package name="default" namespace="/" extends="struts-default">
<default-action-ref name="index" />
<global-results>
<result name="login">/login.jsp</result>
<result name="error">/error.jsp</result>
<result name="leaveList">/leaveList.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="error" exception="java.lang.Exception"></exception-mapping>
</global-exception-mappings>
<action name="index">
<result type="dispatcher">
/WEB-INF/pages/index.jsp
            </result>
</action>

</package>


<!--不受权限控制的Action请求配置-->       
        <package name="non-authority" namespace="/"  extends="json-default" >                   
                <action name="login" class="rightUserAction" method="login">             
                       <result type="json"/>     
                </action>             
          </package>
<!--受权限控制的Action请求配置-->       
        <package name="authority" namespace="/"  extends="json-default,jasperreports-default">       
                <interceptors>       
                        <!--定义一个名为authority的拦截器-->       
                        <interceptor  class="com.donglusoft.rightmanagement.util.AuthorityInterceptor" name="authority"/>
                        <!--定义异常处理的拦截器-->        
                        <interceptor name="exceptionManager" class="com.donglusoft.zzz.util.ExceptionInterceptor"/>     
                        <!--定义一个包含权限检查的拦截器栈-->       
                        <interceptor-stack name="mydefault">       
                                <!--配置内建默认拦截器-->       
                                <interceptor-ref name="defaultStack"/>       
                                <!--配置自定义的拦截器-->       
                                <interceptor-ref name="authority"/>
                                <!--配置自定义的异常处理拦截器-->
                                <interceptor-ref name="exceptionManager"/>       
                        </interceptor-stack>       
                </interceptors>       
                       
                <default-interceptor-ref name="mydefault" />       
                <!--定义全局Result-->       
                <global-results>
                <result name="error">/error.jsp</result>       
                        <result name="login">/login.jsp</result>    
                </global-results>
                <!-- 全局异常的异常映射 -->
                <global-exception-mappings>
<exception-mapping exception="com.donglusoft.zzz.util.SystemExceptions" result="error" />
</global-exception-mappings>             
       </package>
<!-- 各模块struts配置文件 -->
<include file="conf/struts/struts-user.xml"></include>
<include file="conf/struts/struts-leave.xml"></include>
<include file="conf/struts/struts-monitor.xml"></include>
<include file="conf/struts/struts-sampletesting.xml"></include>
<include file="conf/struts/struts-rightmanagement.xml"></include>
<include file="conf/struts/officialdocument.xml"></include>
<include file="conf/struts/struts-license.xml"></include>
<include file="conf/struts/struts-charge.xml"></include>
<include file="conf/struts/struts-bacterin.xml"></include>
<include file="conf/struts/struts-goods.xml"></include>
<include file="conf/struts/struts-healthcard.xml"></include>
<include file="conf/struts/struts-stat.xml"></include>
<include file="conf/struts/struts-person.xml"></include>
<include file="conf/struts/struts-vehicle.xml"></include>

</struts>   

你可能感兴趣的:(struts)