`
zhaole609
  • 浏览: 342730 次
  • 性别: Icon_minigender_1
  • 来自: 河南
社区版块
存档分类
最新评论
阅读更多
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
   
<struts>
    <package name="struts-default">
        <result-types>
            <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
            <result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
            <result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
            <result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
            <result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
            <result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
            <result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
            <result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
            <result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
            <result-type name="plaintext" class="org.apache.struts2.dispatcher.PlainTextResult" />
        </result-types>

        <interceptors>
            <interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
            <interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
            <interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
            <interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
            <interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
            <interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
            <interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
            <interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
            <interceptor name="exception" class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>
            <interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
            <interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
            <interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
            <interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
            <interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
            <interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
            <interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
            <interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
            <interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
            <interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
            <interceptor name="sessionAutowiring" class="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"/>
            <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
            <interceptor name="token" class="org.apache.struts2.interceptor.TokenInterceptor"/>
            <interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
            <interceptor name="validation" class="com.opensymphony.xwork2.validator.ValidationInterceptor"/>
            <interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
            <interceptor name="store" class="org.apache.struts2.interceptor.MessageStoreInterceptor" />
            <interceptor name="checkbox" class="org.apache.struts2.interceptor.CheckboxInterceptor" />
            <interceptor name="profiling" class="org.apache.struts2.interceptor.ProfilingActivationInterceptor" />
           
            <!-- Basic stack -->
            <interceptor-stack name="basicStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
            </interceptor-stack>

            <!-- Sample validation and workflow stack -->
            <interceptor-stack name="validationWorkflowStack">
                <interceptor-ref name="basicStack"/>
                <interceptor-ref name="validation"/>
                <interceptor-ref name="workflow"/>
            </interceptor-stack>

            <!-- Sample file upload stack -->
            <interceptor-stack name="fileUploadStack">
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="basicStack"/>
            </interceptor-stack>

            <!-- Sample model-driven stack  -->
            <interceptor-stack name="modelDrivenStack">
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="basicStack"/>
            </interceptor-stack>

            <!-- Sample action chaining stack -->
            <interceptor-stack name="chainStack">
                <interceptor-ref name="chain"/>
                <interceptor-ref name="basicStack"/>
            </interceptor-stack>

            <!-- Sample i18n stack -->
            <interceptor-stack name="i18nStack">
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="basicStack"/>
            </interceptor-stack>

            <!-- An example of the params-prepare-params trick. This stack
                 is exactly the same as the defaultStack, except that it
                 includes one extra interceptor before the prepare interceptor:
                 the params interceptor.

                 This is useful for when you wish to apply parameters directly
                 to an object that you wish to load externally (such as a DAO
                 or database or service layer), but can't load that object
                 until at least the ID parameter has been loaded. By loading
                 the parameters twice, you can retrieve the object in the
                 prepare() method, allowing the second params interceptor to
                 apply the values on the object. -->
            <interceptor-stack name="paramsPrepareParamsStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
            </interceptor-stack>

            <!-- A complete stack with all the common interceptors in place.
                 Generally, this stack should be the one you use, though it
                 may do more than you need. Also, the ordering can be
                 switched around (ex: if you wish to have your servlet-related
                 objects applied before prepare() is called, you'd need to move
                 servlet-config interceptor up.

                 This stack also excludes from the normal validation and workflow
                 the method names input, back, and cancel. These typically are
                 associated with requests that should not be validated.
                 -->
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="debugging"/>
                <interceptor-ref name="profiling"/>
                <interceptor-ref name="scoped-model-driven"/>
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
            </interceptor-stack>

            <!-- The completeStack is here for backwards compatibility for
                 applications that still refer to the defaultStack by the
                 old name -->
            <interceptor-stack name="completeStack">
                <interceptor-ref name="defaultStack"/>
            </interceptor-stack>

            <!-- Sample execute and wait stack.
                 Note: execAndWait should always be the *last* interceptor. -->
            <interceptor-stack name="executeAndWaitStack">
                <interceptor-ref name="execAndWait">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
                <interceptor-ref name="defaultStack"/>
                <interceptor-ref name="execAndWait">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
            </interceptor-stack>
           
       </interceptors>
       
        <default-interceptor-ref name="defaultStack"/>
    </package>

</struts>

分享到:
评论

相关推荐

    struts.xml文件详解.doc

    Struts.xml文件是Apache Struts 2框架的核心配置文件,它用于定义应用程序的行为、Action映射、结果页面、拦截器等关键组件。在深入讲解struts.xml之前,我们先来了解与之相关的struts.properties文件。 struts....

    struts.xml和struts.properties配置详解

    在Struts中,`struts.xml`和`struts.properties`是两个关键的配置文件,它们定义了应用的行为和设置。下面将详细讲解这两个配置文件的内容、用途以及如何配置。 **一、struts.xml配置详解** `struts.xml`是Struts2...

    struts.xml和applicationContext.xml、web.xml的配置

    在Java Web开发中,`struts.xml`, `applicationContext.xml` 和 `web.xml` 是三个至关重要的配置文件,它们各自负责不同的职责,并协同工作来构建一个完整的应用框架。以下是关于这三个配置文件的详细说明。 首先,...

    Dom4j解析struts2框架的struts.xml

    在Struts2中,`struts.xml`是核心配置文件,它定义了应用的各个组件,如动作(Actions)、结果(Results)、拦截器(Interceptors)等。本篇文章将深入探讨如何使用Dom4j这个XML处理库来解析`struts.xml`,以便...

    struts.xml(struts2配置)

    `struts.xml`是Struts2框架的核心配置文件,用于定义应用程序的行为、控制器、动作映射、结果类型和其他关键组件。下面我们将深入探讨`struts.xml`的各个方面。 1. **配置文件结构** `struts.xml`文件通常位于项目...

    struts.xml的错误解决办法

    在开发过程中,我们经常会遇到与`struts.xml`配置文件相关的错误,这是由于XML解析问题或者DTD(文档类型定义)引用的问题引起的。`struts.xml`是Struts2框架的核心配置文件,它定义了动作、结果、拦截器等关键组件...

    struts.xml文件详解示例代码

    Struts.xml文件是Apache Struts 2框架的核心配置文件,用于定义应用的MVC(Model-View-Controller)架构和动作映射。它为应用程序提供了一种声明式的方式来配置Struts2的行为,使得开发者能够控制请求如何被处理,...

    struts.xml的要准备的jar包

    在使用Struts框架时,`struts.xml`配置文件起着至关重要的作用,它是整个应用的配置中心,定义了动作映射、拦截器、结果类型等核心组件。为了正确运行Struts2框架,我们需要准备一系列的JAR文件,这些库文件提供了...

    struts.xml常用配置解析

    Struts.xml配置文件是Struts2框架的核心配置文件,它定义了应用的行为和结构。本文主要解析了其中两个重要的配置元素:`&lt;include&gt;`标签和Action的别名。 首先,我们来看 `&lt;include&gt;` 标签的使用。当Struts2的应用中...

    dom4j解析struts.xml需要的包装类

    在Struts2中,配置文件`struts.xml`扮演着核心角色,它定义了动作(Action)、包(Package)和结果(Result)等关键组件的行为。为了方便地解析和处理这些配置,开发者常常会创建自定义的包装类(Wrapper Class),...

    struts.xml配置详解

    比如在大型项目中,可以将用户管理、商品管理和订单管理等不同的功能模块分别配置在不同的xml文件中(如user.xml、goods.xml和order.xml),然后通过struts.xml中的标签将这些模块配置文件引入主配置文件中。...

    Struts2中Struts.xml配置文件详解

    "Struts2 中 Struts.xml 配置文件详解" Struts2 中的 Struts.xml 配置文件是 Struts2 框架的核心配置文件,用于定义应用程序的行为和结构。在 Struts.xml 文件中,我们可以定义 package、action、interceptor、...

    如何让Struts.xml有提示

    介绍一种让Struts.xml有提示的方法

    struts2属性文件struts.xml的配置

    ### Struts2属性文件struts.xml的配置 在Java Web开发中,Struts2框架作为MVC模式的一种实现,提供了一种简洁的方式来构建应用程序。其中,`struts.xml`是Struts2的核心配置文件,用于定义项目的包、常量、拦截器等...

    struts.xml 配置

    Struts.xml配置是Apache Struts框架的核心配置文件,它定义了应用程序的行为、控制器以及视图的映射。这篇博文详细介绍了如何理解和配置Struts2框架中的struts.xml文件,以实现MVC(Model-View-Controller)设计模式...

    struts2.0中struts.xml配置文件详解

    在深入探讨Struts2.0框架中的`struts.xml`配置文件之前,我们先来了解一下Struts2.0框架的基本概念。Struts2是Apache软件基金会的一个开源项目,它是一个基于MVC(Model-View-Controller)设计模式的Java Web应用...

    struts.xml中constent属性参数配置大全

    **struts.configuration.xml.reload** - **功能**:是否在每次HTTP请求时重新加载`struts.xml`文件,默认为`false`。 - **示例**:设置为`true`,则每次请求都会检查`struts.xml`文件是否有变化。 ##### 25. **...

Global site tag (gtag.js) - Google Analytics