struts2.0 of struts.xml Detailed

2010-10-26  来源:本站原创  分类:Java  人气:106 

XML file code

<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" >
<struts>

    <!-- include  Node is a component of the way in struts2    Independent of each function module can be a xml configuration file     Then include node reference   -->
    <include file="struts-default.xml"></include>

    <!-- package  Action organizations provide multiple ways for a module
         package  The name must be unique package can be extended     When a package extends
           Another when the package  package  Will be added on the basis of their configuration expansion  package
           The configuration of the parent  package  Package must be configured before the child
         name:package  Name
         extends:  Inherited the name of the parent package
         abstract:  Set the attributes for the abstract package     Package can not be defined in the abstract  action   Value true:false
         namespace:  Package namespace defined     The name of the url address space  ,  For example, the namespace / test then the visit is to address  http://localhost:8080/struts2/test/XX.action
     -->
    <package name="com.kay.struts2" extends="struts-default" namespace="/test">
        <interceptors>
            <!--   Define interceptor
                 name:  The name of the interceptor
                 class:  Interceptor class path
             -->
            <interceptor name="timer"></interceptor>
            <interceptor name="logger"></interceptor>
            <!--   The interceptor stack defined   -->
            <interceptor-stack name="mystack">
                <interceptor-ref name="timer"></interceptor-ref>
                <interceptor-ref name="logger"></interceptor-ref>
            </interceptor-stack>
        </interceptors>

        <!--   Define the default interceptor for each  Action  References are automatically
            If the Action cited the other interceptors     Default interceptor will not work   -->
        <default-interceptor-ref name="mystack"></default-interceptor-ref>

        <!--   Configuring the global results   -->
        <global-results>
            <result name="input">/error.jsp</result>
        </global-results>

        <!-- Action  Configure a  Action  Maps can be several times  (  As long as the action configuration  name  Different  )
              name:action  Name
              class:   The path of the corresponding class
              method:   Action in the name of the method call
        -->
        <action name="hello">
            <!--   Reference interceptor
                 name:  Interceptor name or the name of the interceptor stack
             -->
            <interceptor-ref name="timer"></interceptor-ref>

            <!--   Node Configuration
                 name : result  Name and  Action  The value returned in the same
                 type : result  Do not write the selected type  superpackage  The type struts-default.xml in the default  dispatcher
             -->
         <result name="success" type="dispatcher">/talk.jsp</result>
         <!--   Parameter settings
              name:  Action in the corresponding  get/set  Methods
         -->
         <param name="url">http://www.sina.com</param>
        </action>
    </package>
</struts>
相关文章
  • struts2.0 of struts.xml Detailed 2010-10-26

    XML file code <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" > <struts> <!-- include Node is a component of the way in struts2 Ind

  • "turn 2008-9> Struts2 ---- struts2.0 in struts.xml profile Xiangjie 2010-03-29

    <! DOCTYPE struts PUBLIC "- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <! - Include node is struts2 in component-based approach can be

  • struts2.0 the struts.xml Xiangjie 2010-03-29

    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" > <struts> <!-- include The node is a component in the struts2 way to remove each f

  • struts2.0 the struts.xml profile Xiangjie 2010-04-19

    <! DOCTYPE struts PUBLIC "- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <! - Include node is struts2 in component-based approach can be

  • struts2.0 in struts.xml configuration Xiangjie 2010-05-07

    Quote from kay's blog <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" > <struts> <!-- include The node is a struts2 manner in compo

  • struts2.0 of struts.xml Xiangjie 2010-07-11

    <! DOCTYPE struts PUBLIC "- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <! - Include components of the node is the struts2 way in each

  • struts2.0中struts.xml配置文件详解 2010-03-25

    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" > <struts> <!-- include节点是struts2中组件化的方式 可以将每个功能模块独立到一个xml配置文件中 然后用include节点引用 --&g

  • 编写struts2的配置文件struts.xml注意事项 2012-03-26

    编写struts2的配置文件struts.xml时,以下属性已经启用了,不用再配置了: <!-- 已经在struts2-spring-plugin的struts-plugin.xml中指定了 -->

  • [Zhang Bing Struts2 study notes] 0402.struts.xml Detailed configuration space contains the name of the second 2010-11-25

    Detailed struts.xml configuration space contains the name of the second 1. Name of space package namespace attribute element in the package can be configured for different action name space, so that you can use a different namespace named action. Str

  • [Zhang Bing Struts2 study notes] 0403.struts.xml Detailed configuration of the three-block configuration 2010-11-25

    Detailed configuration of the three struts.xml interceptor configuration 1. Interceptor (Interceptor) configuration Interceptors to be called in action before and after being called to perform some "code." Struts2 framework for most of the core

  • [Zhang Bing Struts2 study notes] 0601.struts.xml Detailed configuration wildcard Six Action Configuration 3 2010-11-26

    Detailed configuration of six wildcards struts.xml 1. Action configuration 1.7, wildcard mapping Wildcard pattern: can contain one or more of the following special tokens Special mark Help * Match 0 or more characters, a slash (/) character, except *

  • [Zhang Bing Struts2 study notes] 0502.struts.xml Detailed configuration of the five Action Configuration 2 2010-11-26

    Detailed configuration of the five Action struts.xml Configuration 2 1. Action configuration 1.1, method attributes and dynamic method calls attention to points 1, method attribute can automatically match doXXX () methods, such as doAdd (), visited t

  • struts2中改变struts.xml默认路径 或可能遇到的问题 2012-11-09

    struts2.X配置文件默认存放路径在/WEB-INF/classes目录下,即将struts.xml放在src的目录下. 但是为了方便管理,开发人员把struts.xml放到其他位置,处理方法如下. 首先要明白struts2加载配置文件都是从自己的jar包和/WEB-INF/classes两个默认的位置加载的. 若修改struts2.x配置文件的存放位置,在web.xml配置过虑器时,具体配置如下: <filter> <filter-name>struts2</filte

  • struts2.0 upload download 2010-03-05

    struts2.0 Upload Process I. 1, jsp page form method = "post" enctype = "multipart / form-data" <s:file name="file"> </ s: file> 2, strut-xx.xml normal configuration 3, web.xml adding <filter> <filter-name

  • struts2 struts.xml Xiangjie 2010-08-10

    <! DOCTYPE struts PUBLIC "- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <! - Include components of the node is the struts2 way in each

  • Struts2 related to struts-default.xml, struts.xml, struts.properties file Xiangjie 2009-03-21

    Each study a framework, we will inevitably have to learn some information about the configuration file, struts2 is no exception, here I will talk about several major struts2 configuration file. 1) struts-default.xml This file is the struts2 framework

  • Struts2的struts.xml的配置细节,OGNL,标签 2013-12-09

    (七)Struts2的struts.xml的配置细节 这里说的struts.xml说到的包含内容如下: 1.include包含另一个xml 2.默认action,主要用于跳转不存在的页面,到我们自定义的一个好看的页面,而不是难看的错误页面. 3.struts.xml中action下的result的类型 4.struts.xml中的Global_Results,全局结果集 5.struts.xml中的动态结果集 6.struts.xml带参数的结果集 一.include包含另一个xml文件:主要用

  • Struts2的struts.xml的配置细节 2013-12-09

    (七)Struts2的struts.xml的配置细节 这里说的struts.xml说到的包含内容如下: 1.include包含另一个xml 2.默认action,主要用于跳转不存在的页面,到我们自定义的一个好看的页面,而不是难看的错误页面. 3.struts.xml中action下的result的类型 4.struts.xml中的Global_Results,全局结果集 5.struts.xml中的动态结果集 6.struts.xml带参数的结果集 一.include包含另一个xml文件:主要用

  • Java:struts2之struts.xml 配置详解整理........ing 2014-03-14

    <! DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" > < struts > <!-- include节点是struts2中组件化的方式 可以将每个功能模块独立到一个xml配置文件中 然后用include节点引用 -

  • "turn> Struts2 in struts.xml the use of namespace configuration 2010-03-29

    Transfer from: http://www.blogjava.net/Unmi/archive/2008/05/26/203014.html Struts2 is the struts.xml sub-package configurations, you can set the namespace for the package properties, such as the <package namespace="/secure" ....> ...... &l