struts.xml配置文件启用开发者模式
来源:互联网 发布:网络管理零基础知乎 编辑:程序博客网 时间:2024/06/06 10:38
开发者模式devMode的作用:
启动devMode之后,Struts2将提供有利于开发工作的特性,具体包括:
1、 更改.properties配置文件后,无需重启web服务器即可生效。该功能也可通过设置struts.i18n.reload=true来实现。
2、更改struts.xml或校验文件后,无需重启web服务器即可生效。该功能也可通过设置struts.configuration.xml.reload=true来实现。
3、提高报错等级,降低容错标准,将原先warning、info、甚至debug级别的信息作为error而抛出。换而言之,把任何潜在错误的蛛丝马迹暴露给开发人员。
devMode的代价
使用devMode是有代价的 — 启动devMode之后,对于每一个HTTP请求,Struts2都会重新加载并解析所有的配置文件(.properties, struts.xml, 校验文件等等),这对应用程序的性能无疑会产生极大的影响。同时,由于devMode降低了容错标准,程序运行过程中更容易抛出异常,这也会对Web服务的日常进行产生干扰。
在我们项目开发过程中,需要经常对配置文件进行更改,在strutsx.xml配置文件中,我们可以添加以下常用配置,从而解决我们因更改配配置文件后而需要重新启动服务这一过程.( 自己的Tomcat路径不要包含空格。)
具体的配置代码如下:
<!-- 开启使用开发模式,详细错误提示 -->
<constant name="struts.devMode" value="true"/>
<!-- 指定每次请求到达,重新加载资源文件 -->
<constant name="struts.i18n.reload" value="true"/>
<!-- 指定每次配置文件更改后,自动重新加载 -->
<constant name="struts.configuration.xml.reload" value="true"/>
<!-- 指定XSLT Result使用样式表缓存 -->
<constant name="struts.xslt.nocache" value="true"/>
阅读全文
0 0
- struts.xml配置文件启用开发者模式
- struts.xml配置文件启用开发者模式
- 9.Struts配置文件 - struts.xml
- struts配置文件 struts-config.xml
- Struts配置文件struts.xml详解
- struts2 配置文件 struts.xml
- struts-config.xml配置文件
- struts-config.xml配置文件
- struts.xml配置文件详解
- 配置文件struts.xml详解
- struts.xml配置文件
- struts-config.xml配置文件
- ssh - 配置文件 - struts.xml
- struts.xml配置文件说明
- struts.xml配置文件
- struts.xml配置文件
- struts-config.xml配置文件
- struts.xml配置文件小结
- 安卓录屏
- Java访问控制修饰符与继承
- Android进阶#(1/12)Android的构成基石——四大组件_ContentProvider(外共享数据)
- android tween动画
- MYSQL explain详解
- struts.xml配置文件启用开发者模式
- FZU
- 复试计划篇(上)
- 2D图形编程指南
- C# winform 为按钮添加键盘快捷键
- DOM的事件
- 【POJ 3264】Balanced Lineup(RMQ算法||线段树)
- Go语言学习之cgo(golang与C语言相互调用)
- jQuery实现水平和垂直居中