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 ...
随机推荐
- 线段树好题(2004集训队林涛PPT中的3题)
1.snake:主要是要意识到全局的可能连法只有一种= =(略坑,题目的最小长度是唬人的……),所以关键就是能否构造出符合题意的图,可以考虑搜索解决,搜出一个就OK了,但是会发现那些满足条件中线段在非 ...
- JS事件学习笔记(思维导图)
导图
- ansible 配置运行环境
P34 2.3.1 配置ansible的环境 ansible的配置文件是以ini格式存储配置数据的,在ansible中几乎所有的配置都可以通过playbook或者环境变量来重新赋值 运行ansible ...
- CXF 自定义拦截器
此例子来自apache cxf sample. /** * Licensed to the Apache Software Foundation (ASF) under one * or more ...
- Opentack常用技巧
这篇博客将收集一些openstack里的使用技巧. 1. which dhcp agent is hosting the network? 2. 各个网桥port命令规则 grep for por ...
- Cocos2d-X3.0 刨根问底(二)----- 从HelloWorld开始
小鱼习惯直接从代码实例来学习一套成型的引擎库. 运行cpp-empty-test 一个典型的HelloWorld程序翻看代码结构 看到了 main.h与main.cpp文件就从这里开始 #ifndef ...
- 洛谷P2633 王后万岁
题目描述 byteland的王后深受百姓爱戴.为了表达他们的爱,国民们打算占领一个新的国家,并以王后的名字命名.这个国家有n座城市.城市之间有双向道路连接,且每两个城市之间有且仅有一条道路.每座城市对 ...
- Erlang练习题----shopping
直接就上代码了: -module(shop). -export([cost/1,total/1]). cost(orange) -> 5; cost(newspaper) -> 8; co ...
- Myeclipse连接mysql数据库
第一步:下载mysql驱动 驱动地址:http://www.mysql.com/products/connector/ .选择JDBC Driver for MySQL (Connector/J). ...
- Activity的成员变量
// set by the thread after the constructor and before onCreate(Bundle savedInstanceState) is called. ...