struts2常见配置
<struts>
<!--开发模式设置:该属性设置Struts2应用是否使用开发模式。如果设置该属性为true,则可以在应用出错时显示更多、更友好的出错提示。该属性只接受true和flase两个值,该属性的 默认值是false。通常,应用在开发阶段,将该属性设置为true,当进入产品发布阶段后,则该属性设置为false。 -->
<constant name="struts.devMode" value="false"></constant>
<!-- 国际化资源重新加载:该属性设置是否每次HTTP请求到达时,系统都重新加载资源文件。该属性默认值是false。在开发阶段将该属性设置为true会更有利于开发, 但在产品发布阶段应将该属性设置为false。 -->
<constant name="struts.i18n.reload" value="false" />
<!-- 配置文件重新加载:该属性设置当struts.xml文件改变后,系统是否自动重新加载该文件。该属性的默认值是false。 -->
<constant name="struts.configuration.xml.reload" value="false" />
<!-- convention类重新加载 -->
<constant name="struts.convention.classes.reload" value="false" />
<!-- 主题:该属性指定视图标签默认的视图主题,该属性的默认值是xhtml -->
<constant name="struts.ui.theme" value="simple" />
<!-- 地区 -->
<constant name="struts.locale" value="zh_CN" />
<!-- spring -->
<!-- <constant name="struts.objectFactory" value="spring"/> -->
<!-- <constant name="struts.objectFactory.spring.autoWire" value="byName"/> -->
<!-- 国际化编码:指定Web应用的默认编码集,相当于调用 HttpServletRequest的setCharacterEncoding方法 -->
<constant name="struts.i18n.encoding" value="UTF-8" />
<!-- 扩展:该 属性指定需要Struts 2处理的请求后缀,该属性的默认值是action,即 所有匹配*.action的请求都由Struts 2处理。如果用户需要指定多个请求后缀,则多个后缀之间以英文逗号(,)隔开 -->
<constant name="struts.action.extension" value="action" />
<!-- 启用动态方法调用:该属性设置Struts 2是否支持动态方法调用,该属性的默认值是true(也区分版本)。如果需要关闭动态方法调用,则可设置该属性为false -->
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<!-- 设置Struts 2是否允许在Action名中使用斜线,默认是false -->
<constant name="struts.enable.SlashesInActionNames" value="false" />
<!-- action后缀 -->
<constant name="struts.convention.action.suffix" value="Action" />
<!-- 名称首字母小写 -->
<constant name="struts.convention.action.name.lowercase"
value="true" />
<!-- 分隔符 一个action名字的获取。比如为HelloWorldAction。按照配置,actionName为hello_world。 -->
<constant name="struts.convention.action.name.separator"
value="" />
<!-- 禁用扫描 -->
<constant name="struts.convention.action.disableScanning"
value="false" />
<!-- 默认包 -->
<constant name="struts.convention.default.parent.package"
value="default" />
<!--确定搜索包的路径。只要是结尾为action的包都要搜索。basePackage按照默认不用配置,如果配置,只会找以此配置开头的包。
locators及locators.basePackage都是一组以逗号分割的字符串。 -->
<constant name="struts.convention.package.locators" value="action" />
<!-- 禁用包搜索 -->
<constant name="struts.convention.package.locators.disable"
value="false" />
<!-- 告诉struts2 需要在哪些jar包中去搜索 action -->
<constant name="struts.convention.action.includeJars" value=".*/jenny-plugin.*?jar(!/)?," />
<!-- 告诉struts2 去包中查找action的包文件类型,默认是jar,如果在webspher上可能会出问题,需要添加 wsjar -->
<constant name="struts.convention.action.fileProtocols" value="jar" />
<!-- 基于什么包 -->
<constant name="struts.convention.package.locators.basePackage"
value="com.speed.call.plugin.server.action" />
<!-- 排除的包 -->
<constant name="struts.convention.exclude.packages"
value="org.apache.struts.*,org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*" />
<constant name="struts.convention.result.flatLayout" value="false" />
<constant name="struts.convention.action.mapAllMatches" value="false" />
<package name="default" namespace="/" extends="struts-default">
<result-types>
<result-type name="json" class="org.apache.struts2.json.JSONResult">
<param name="excludeNullProperties">true</param>
<param name="noCache">true</param>
<param name="contentType">text/html</param>
</result-type>
<!-- result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult">
<param name="contentType">image/jpeg</param>
<param name="inputName">imageStream</param>
<param name="bufferSize">1024</param>
</result-type-->
</result-types>
<interceptors>
<interceptor name="json"
class="org.apache.struts2.json.JSONInterceptor" />
<interceptor name="annotation"
class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />
<interceptor-stack name="myDefaultStack">
<interceptor-ref name="json" />
<interceptor-ref name="annotation" />
<interceptor-ref name="defaultStack">
<param name="exception.logEnabled">true</param>
<param name="exception.logLevel">ERROR</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="myDefaultStack"/>
</package>
</struts>
struts2常见配置的更多相关文章
- Struts2常见配置(草稿)
Struts2框架配置文件加载的顺序(了解加载配置文件的顺序,重点掌握struts.xml配置文件) 1.Struts2框架的核心是StrutsPrepareAndExecuteFilter过滤器,该 ...
- struts2常见配置解决错误There is no mapped for namespace[/] and action name
我碰到这个错误的原因是我把配置文件名写成了Struts.xml,改成struts.xml就可以了. 在确定struts.xml本身并没有写错的情况下,那么发生错误有可能是路径,配置文件名. 如果实在找 ...
- struts2学习笔记(三)—— struts2的常见配置
一.配置文件的加载顺序 每次从客户端发送请求到服务器都要先经过Struts2的核心过滤器StrutsPrepareAndExecuteFilter,这个过滤器有两个功能:预处理和执行.在预处理中主要就 ...
- Struts2 XML配置详解
struts官网下载地址:http://struts.apache.org/ 1. 深入Struts2的配置文件 本部分主要介绍struts.xml的常用配置. 1.1. 包配置: S ...
- 深入 Struts2 的配置 - 处理多个请求-处理请求结果-模型驱动-异常机制
转:http://www.java3z.com/cwbwebhome/article/article2/2938.html?id=1631 本部分主要介绍struts.xml的常用配置. 1.1. ...
- Struts2 基本配置
Struts2是一个优秀的MVC框架,也是我比较喜欢用的框架.它个各种配置基本都可以集中在一个xml文档中完成.现在让我们看看如何简单几步实现常用功能. 一.搭建Struts2的开发环境 1)首先是利 ...
- struts2 action配置时 method 省略不写 默认执行方法是父类ActionSuppot中的execute()方法
struts2 action配置时 method 省略不写 默认执行方法是父类ActionSuppot中的execute()方法
- struts2环境配置
struts2环境配置 struts2框架,大多数框架都在使用.由于工作需要,开始做Java项目.先学个struts2. 一.下载struts2 有好多版本,我下载的是struts-2.2.1.1. ...
- 在Struts2中配置Action
在Struts2中配置Action <package>: 1.定义Action使用<package>标签下的<action>标签完成,一个<package&g ...
随机推荐
- OC self和super
在OC中 1 self是一个指针,在每一个方法中都有一个self指针 2 self可以出现在所有的方法中(对象方法和类方法),不能在函数中 3 self指向调用者.(谁调用它就指向谁) 4 可以使用s ...
- MATLAB画ROC曲线,及计算AUC值
根据决策值和真实标签画ROC曲线,同时计算AUC的值 步骤: 根据决策值和真实标签画ROC曲线,同时计算AUC的值: 计算算法的决策函数值deci 根据决策函数值deci对真实标签y进行降序排序,得到 ...
- SQL Server数据库(SQL Sever语言 函数以及SQL编程)
1.数学函数:操作一个数据,返回一个结果 --去上限: ceiling ☆select ceiling(price) from car --去下限:floor ☆select floor(price) ...
- SQL语句技巧(上个样式太差了)
以下并非本人整理,但是看后感觉相当不错,特此分享. 1.应用程序中,保证在实现功能的基础上,尽量减少对数据库的访问次数:通过搜索参数,尽量减少对表的访问行数,最小化结果集,从而减轻网络负担:能够分 ...
- Sui 弹框固定
SUI是一套基于bootstrap开发的前端组件库,同时它也是一套设计规范,可以非常方便的设计和实现精美的页面,是一个简单易用.功能强大的UI库.自己在使用sui过程之中,总是忘记它的一些Api,今天 ...
- 337. House Robber III——树的题目几乎都是BFS、DFS,要么递归要么循环
The thief has found himself a new place for his thievery again. There is only one entrance to this a ...
- NSDateFormatter 根据时间戳求出时间
NSDateFormatter 根据时间戳求出时间 - (void)detailWithStyle:(NSString*)style time:(NSInteger)time { // NSStrin ...
- bzoj 2744: [HEOI2012]朋友圈
#include<cstdio> #include<iostream> #define M 3010 using namespace std; ],u[M*M>>] ...
- centos下cmake安装
步骤一.安装gcc等必备程序包(已安装则略过此步,用gcc -v检测) yum install -y gcc gcc-c++ make automake 步骤二.安装wget (已安装则略过此步) y ...
- for循环语句示例应用
age = 22 #优化前 ''' for i in range(10): guess_num = int(input('input your guess num:')) if guess_num = ...