天天看點

引用 Struts2中有關struts-default.xml,struts.xml,struts.

 每學習一個架構,我們都免不了要學習一些關于的配置檔案,struts2也不例外,下面我就講一下struts2中幾個主要的配置檔案。

1) struts-default.xml

這個檔案是struts2架構預設加載的配置檔案。它定義struts2一些核心的bean和攔截器。

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<?xml version="1.0" encoding="UTF-8" ?>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!DOCTYPE struts PUBLIC

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    "http://struts.apache.org/dtds/struts-2.0.dtd">

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

<struts>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--struts2中工廠bean的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.ActionProxyFactory" name="struts" class="org.apache.struts2.impl.StrutsActionProxyFactory"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--類型檢測bean的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="tiger" class="com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="notiger" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="struts" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--檔案上傳bean的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts" class="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="composite" class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful" class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful2" class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--标簽庫bean的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--一些常用視圖bean的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.views.freemarker.FreemarkerManager" name="struts" optional="true"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.views.velocity.VelocityManager" name="struts" optional="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.components.template.TemplateEngineManager" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.components.template.TemplateEngine" name="ftl" class="org.apache.struts2.components.template.FreemarkerTemplateEngine" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.components.template.TemplateEngine" name="vm" class="org.apache.struts2.components.template.VelocityTemplateEngine" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="org.apache.struts2.components.template.TemplateEngine" name="jsp" class="org.apache.struts2.components.template.JspTemplateEngine" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--類型轉換bean的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.util.XWorkConverter" name="xwork1" class="com.opensymphony.xwork2.util.XWorkConverter" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.util.XWorkConverter" name="struts" class="com.opensymphony.xwork2.util.AnnotationXWorkConverter" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.TextProvider" name="xwork1" class="com.opensymphony.xwork2.TextProviderSupport" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean type="com.opensymphony.xwork2.TextProvider" name="struts" class="com.opensymphony.xwork2.TextProviderSupport" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <!--  Struts2中一些可以靜态注入的bean,也就是不需要執行個體化的 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="com.opensymphony.xwork2.ObjectFactory" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="com.opensymphony.xwork2.util.XWorkConverter" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="com.opensymphony.xwork2.util.OgnlValueStack" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.dispatcher.Dispatcher" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.components.Include" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.dispatcher.FilterDispatcher" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.views.util.ContextUtil" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <bean class="org.apache.struts2.views.util.UrlHelper" static="true" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!-- 定義Struts2預設包-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <package name="struts-default" abstract="true">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    <!-- 結果類型的種類-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

        <result-types>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <result-type name="plaintext" class="org.apache.struts2.dispatcher.PlainTextResult" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

        </result-types>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--struts2中攔截器的定義-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

        <interceptors>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

        <!--實作在不同請求中相似參數别名的準換-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--與Spring整合時自動裝配的攔截器-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--建構一個action鍊,使目前action可以通路前一個action,與<result-type="chain" 

引用 Struts2中有關struts-default.xml,struts.xml,struts.

/>配合使用-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--負責類型轉換的攔截器-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--使用配置的name,value來是指cookies -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

           <!--負責建立httpSession-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--輸出調試資訊-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--擴充引用-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="externalRef" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--背景執行action負責發送等待畫面給使用者-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--異常處理-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="exception" class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--檔案上傳,解析表單域的内容-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--支援國際化-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

           <!--日志記錄-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--模型攔截器,當action實作了ModelDriven接口時,負責把getModel的結果放入valueStack中-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--有生命周期的ModelDriven-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="scopedModelDriven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--負責解析請求中的參數,并指派給action中對應的屬性-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--實作該Preparable接口的action,會調用攔截器的prepare方法-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--負責将action 标簽下的param參數值傳遞給action執行個體-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="staticParams" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--範圍轉換-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--用于通路Servlet API-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="servletConfig" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="sessionAutowiring" class="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--輸出action執行時間-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--防止表單重複送出-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="token" class="org.apache.struts2.interceptor.TokenInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--與token攔截器相似,隻是把token儲存到HttpSession-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--負責表單字段的驗證 *-validation.xml-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="validation" class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--負責執行action的validate()-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--存儲和重新擷取Action 消息/錯誤/字段錯誤為Action,實作ValidationAware接口到seesion-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="store" class="org.apache.struts2.interceptor.MessageStoreInterceptor" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--添加自動checkbox處理代碼,這樣檢探測checkbox和添加它作為一個參數使用預設值(通常’false’).使用一個指定名字隐藏字段探測沒送出的checkbox-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="checkbox" class="org.apache.struts2.interceptor.CheckboxInterceptor" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="profiling" class="org.apache.struts2.interceptor.ProfilingActivationInterceptor" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--JAAS服務攔截器-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" />

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!-- 一個基本的攔截器棧 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="basicStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="exception"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="servletConfig"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="prepare"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="checkbox"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="params"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="conversionError"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!-- 簡單的validtion和webflow棧 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="validationWorkflowStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="basicStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="validation"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="workflow"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!-- 檔案上傳的攔截器棧 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="fileUploadStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="fileUpload"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="basicStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!-- model-driven 棧  -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="modelDrivenStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="modelDriven"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="basicStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!-- action鍊的攔截器棧 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="chainStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="chain"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="basicStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--  i18n 攔截器棧 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="i18nStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="i18n"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="basicStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!-- 結合preparable和ModenDriven攔截器-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="paramsPrepareParamsStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="exception"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="alias"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="params"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="servletConfig"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="prepare"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="i18n"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="chain"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="modelDriven"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="fileUpload"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="checkbox"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="staticParams"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="params"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="conversionError"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="validation">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                    <param name="excludeMethods">input,back,cancel</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="workflow">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                    <param name="excludeMethods">input,back,cancel</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <!--定義預設的攔截器棧  -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="defaultStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="exception"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="alias"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="servletConfig"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="prepare"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="i18n"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="chain"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="debugging"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="profiling"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="scopedModelDriven"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="modelDriven"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="fileUpload"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="checkbox"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="staticParams"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="params">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                  <param name="excludeParams">dojo\..*</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="conversionError"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="validation">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                    <param name="excludeMethods">input,back,cancel,browse</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="workflow">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                    <param name="excludeMethods">input,back,cancel,browse</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="completeStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="defaultStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor-stack name="executeAndWaitStack">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="execAndWait">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                    <param name="excludeMethods">input,back,cancel</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="defaultStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                <interceptor-ref name="execAndWait">

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                    <param name="excludeMethods">input,back,cancel</param>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

                </interceptor-ref>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            </interceptor-stack>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

            <interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

       </interceptors>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!--定義預設攔截器為"defaultStack"-->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

        <default-interceptor-ref name="defaultStack"/>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

    </package>

引用 Struts2中有關struts-default.xml,struts.xml,struts.
引用 Struts2中有關struts-default.xml,struts.xml,struts.

</struts>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

2) struts.xml

該檔案也是struts2架構自動加載的檔案,在這個檔案中可以定義一些自己的action,interceptor,package等,該檔案的package 通常繼承struts-default包。下面是這個檔案的格式。

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<?xml version="1.0" encoding="GBK"?>

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!-- 下面指定Struts 2配置檔案的DTD資訊 -->

引用 Struts2中有關struts-default.xml,struts.xml,struts.

<!DOCTYPE struts PUBLIC

引用 Struts2中有關struts-default.xml,struts.xml,struts.

"-//Apache Softwa