Struts2配置文件模板
<?xml version = "1.0" encoding = "UTF-8"?>
<!--下面是Struts2配置文件的DTD信息 -->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<!--struts是struts2配置文件的跟元素 -->
<struts>
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<constant name="" value="" />
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<bean type="" name="" class="" scope="" static="" optional="" />
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<include file="" />
<!--package元素是struts配置文件的核心,该元素可以出现0次,或者是无限多次 -->
<package name="必填的包名" extends="" namespace="" abstract="" externalReferenceResovler>
<!--以下该元素可以出现,也可以不出现,最多出现一次 -->
<result-types>
<!--以下该元素必须出现,可以出现无数多次 -->
<result-type name="" class="" default="true\false">
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值 </param>
</result-type>
</result-types>
<!--以下的该元素可以出现,也可以不出现,但最多出现1次 -->
<interceptors>
<!--interceptors元素的子元素interceptor元素和interceptor-stack至少出现其中之一,也可以两者都出现 -->
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<interceptor name="" class="">
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值 </param>
</interceptor>
<!--下面的元素可以出现0次,也可以出现无限多次 -->
<interceptor-stack name="">
<!-- 下面的元素必须出现,可以出现无数多次 -->
<interceptor-ref name="">
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<default-interceptor-ref name="">
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</default-interceptor-ref>
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<default-action-ref name="">
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</default-action-ref>
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<global-results>
<!-- 该元素必须出现,可以出现无限多次 -->
<result name="" type="">
<!-- 该字符串内容可以出现0次或者多次 -->
映射资源
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</result>
</global-results>
<!-- 下面的元素可以出现0次,也可以出现多次 -->
<global-exception-mappings>
<!-- 该元素必须出现,可以出现多次 -->
<exception-mapping name="" exception="" result="">
异常处理资源
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</exception-mapping>
</global-exception-mappings>
<action name="" class="" method="" convertor="">
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<result name="" type="">
映射资源
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</result>
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<interceptor-ref name="">
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</interceptor-ref>
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<exception-mapping name="" exception="" result="">
异常处理资源
<!-- 下面的元素可以出现0次,也可以出现无限多次 -->
<param name="参数名">参数值</param>
</exception-mapping>
</action>
</package>
</struts>
Struts2配置文件模板的更多相关文章
- Struts2配置文件详解
解决在断网环境下,配置文件无提示的问题我们可以看到Struts.xml在断网的情况下,前面有一个叹号,这时,我们按alt+/ 没有提示,这是因为” http://struts.apache.org/d ...
- Struts2 配置文件result的name属性和type属性
Struts2 配置文件result的name属性和type属性:Name属性SUCCESS:Action正确的执行完成,返回相应的视图,success是 name属性的默认值: NONE:表示Act ...
- Struts2配置文件讲解
解决在断网环境下,配置文件无提示的问题我们可以看到Struts.xml在断网的情况下,前面有一个叹号,这时,我们按alt+/ 没有提示,这是因为” http://struts.apache.org/d ...
- (二)Struts2配置文件
一.web.xml文件 web.xml配置文件是一种J2EE配置文件,决定servlet容器的HTTP元素需求如何进行处理.它严格来说不是一个Struts2 配置文件,但它是Struts2 运作所需要 ...
- Struts2的模板和主题theme及自定义theme的使用
Struts2的模板和主题theme及自定义theme 标签: struts2 2016-03-29 11:22 190人阅读 评论(0) 收藏 举报 分类: javaweb(8) Struts2 ...
- Struts2配置文件
Struts2配置文件 简介: 与Struts2相关的配置文件有好几个,常用的有 struts.properties , web.xml, struts.xml等.web.xml中配置Struts2的 ...
- struts2配置文件中action的name属性
struts2配置文件中action的name属性的第一个字符不要加斜杠 <action name="see" class="baoxiuManage_seeAct ...
- Struts2 配置文件小结
每次写的博文都被管理员都被移出首页,好气!还希望有哪位大神可以指点迷津-- struts2 配置文件的 result 节点 result 节点是 action 节点的子节点,他代表着 action 方 ...
- ssh框架中spring整合hibernate的配置文件模板(带详细注释)
applicationContext.xml的配置文件模板 <?xml version="1.0" encoding="UTF-8"?> <b ...
随机推荐
- css自定义字体
@font-face { font-family: 华文隶书; src: url( ../font/STLITI.eot ); /* IE */ src: url( ../font/STLITI.tt ...
- iOS - 获取手机中所有图片
1 #import <AssetsLibrary/AssetsLibrary.h> /** 6 * ALAssetsLibrary.h 代表资源库(所有的视频,照片) 7 ALAssets ...
- C/C++语言算法题——替换
[问题] Description 给定一个有限长度的非负整数序列.一次操作是指从第一个元素开始,依次把数列中的每个数替换为它右边比它小的数的个数.对该数列不断进行这个操作.总有一个时刻该数列将不再发生 ...
- int和integer的比较
程序代码: Integer i01 = 59; int i02 = 59; Integer i03 =Integer.valueOf(59); Integer i04 = new Integer(59 ...
- Java集合类: Set、List、Map、Queue使用
目录 1. Java集合类基本概念 2. Java集合类架构层次关系 3. Java集合类的应用场景代码 1. Java集合类基本概念 在编程中,常常需要集中存放多个数据.从传统意义上讲,数组是我们的 ...
- P1391 走廊泼水节
时间: 1000ms / 空间: 131072KiB / Java类名: Main 背景 话说,中中带领的OIER们打算举行一次冬季泼水节,当然这是要秘密进行的,绝对不可以让中中知道.不过中中可是老 ...
- C#获取本机IP且过滤非真实网卡(如虚拟机网卡)
参考了网上的文章,具体地址不记得了. 下面的方法可以过滤掉虚拟机的网卡等无效网卡,进而只留下真实的网卡. using System; using System.Collections.Generic; ...
- Notions of Flow Networks and Flows
这篇随笔是对算法导论(Introduction to Algorithms, 3rd. Ed.)第26章 Maximum Flow的摘录. ------------------------------ ...
- 栈的的链式实例LinkStack实现
1.#include <stdio.h>#include <malloc.h>#include "LinkList.h"typedef struct _ta ...
- electron加载jquery报错问题
<!-- Insert this line above script imports --> <script>if (typeof module === 'object') { ...