Constant Configuration(常量配置)
来源:互联网 发布:算法导论第二版百度云 编辑:程序博客网 时间:2024/05/16 11:44
常量提供了一个简单的方法定义struts应用通过定义键值,这些键值修改框架和插件的行为。这里有两种键的角色。第一种为:他们被用来重写已设定的值,比如文件上传的最大值或者是struts框架是否应该在"devMode"模式下。第二种:他们确定了Bean的实现,在一个给定的类型下的多个实现中,哪一个应该被选择。
常量能够在多个文件中被声明。默认的,常量搜索按以下的顺序,允许后面的文件重写前面的:struts-default.xml,struts-plugin.xml,struts.xml,struts.properties,web.xml。
在WebWork中struts.properties文件提供了向后兼容性。
在多种多样的XML变量中,常量元素有两个必须的属性:name和value。
在struts.properties文件中,每一个实体被当做一个常量。
在web.xml文件中,任何FilterDispatcher的初始化的参数被作为常量。
常量例子(struts.xml)
<struts>
<constant name="struts.devMode" value="true"/>
</struts>
在web.xml文件中
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <filter> <filter-name>struts</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> <init-param> <param-name>struts.devMode</param-name> <param-value>true</param-value> </init-param> </filter> ...</web-app>
0 0
- Constant Configuration(常量配置)
- Struts 2 constant 常量配置
- struts框架<constant>常量配置
- struts.xml中配置常量constant详解
- struts.xml 中配置常量constant详解
- struts.xml 中配置常量constant详解
- struts.xml 中配置常量constant详解
- struts.xml 中配置常量constant详解
- constant常量
- 详解struts.xml配置文件constant常量配置问题
- Struts2源码中所列 常量Constant配置清单
- struts2: Constant Configuration
- Struts2配备精要之常量constant配置详解(包括零配置Convention 的常量)
- struts2中的 常量 constant
- 提炼常量 Extract Constant
- 常量折叠 Constant folding
- Constant folding 常量折叠
- Oracle GoldenGate Configuration-列不对称带有常量的配置
- setNumMapTasks() 在Eclipse中无效
- 归并排序
- 《使用ImageSwitcher实现如下效果》
- MySQLdb 参数处理的坑
- 利用两个栈实现的队列
- Constant Configuration(常量配置)
- 用python爬虫抓取搜索引擎的提示关键字
- 源代码
- iOS程序中调用系统自带应用(短信,邮件,浏览器,地图,appstore,拨打电话)
- linux命令
- 运动目标检测小程序之修改版
- 提升Android ListView性能的几个技巧
- Oracle官方并发教程(1)
- WIN8/7: 80端口被SYSTEM占用的解决方法