Struts 2 – Development mode example

In Struts 2 development, this should be the first configurable value to learn. To enable the Struts 2 development mode, you can significantly increase your Struts 2 development speed by giving auto configuration and properties files reload and extra logging and debugging feature.

The auto reload feature is really a convenient feature. Each time i made changed in properties or XML configuration file, the application is no longer need to restart to take effect.

By default, the Struts 2 development mode is disabled.

Enable the Strut2 development mode

Set the “struts.devMode” value to true, either in Struts properties file or XML configuration file.

struts.properties

struts.devMode = true

  

struts.xml

<struts>
 	<constant name="struts.devMode" value="true" />
</struts>

  

Disable the Strut2 development mode

Set the “struts.devMode” to false, either in Struts properties file or XML configuration file.

struts.properties

struts.devMode = false

  

struts.xml

<struts>
 	<constant name="struts.devMode" value="false" />
</struts>

  

The development mode is only suitable in development or debugging environment. In production environment, you HAVE TO disabled it. It will caused significant impact on performance, because the entire application configuration, properties files will be reloaded on every request, many extra logging and debug information will be provide also.

Before commit Struts configuration file, just make sure the development mode is turn off. I saw many accidentally commit cases – commit with development mode enable, and someone just grab the source code for QA environment. To be Frankly, QA seldom will do the performance test, they just make sure the functionality are there, and end with a development mode enabled application deployed to the production. Guess what? you will receive many screaming phone calls from clients very soon…

Reference

  1. Struts 2 development mode documentation
时间: 2024-10-19 11:22:07

Struts 2 – Development mode example的相关文章

struts 标签库注解

在struts2中有着一套像html一样的标签,俗称struts2标签,大多数公司使用ssh都是使用html标签,但为了保持项目的统一性,有的公司还是使用的struts2的标签,下面是一些常用的struts2标签:  a    a标签创建一个HTML超链接,等价于HTML 的<a  href="".... 示范代码: <s:a href="login.action">登陆</s:a>  action    使用action标签 可以允许

Domain Driven Design and Development In Practice--转载

原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about mapping business domain concepts into software artifacts. Most of the writings and articles on this topic have been based on Eric Evans' book "Domain Dr

Struts后经验总结

1.struts 主要围着“action”,只要找到“action”它就知道自己该干嘛了. 首先配置struts.xml ,我们可以明白的看到,action name="index",而result 需要返回到一个界面“index.jsp”,具体代码如下: <struts> <package name="default" namespace="/" extends="struts-default"> &

Struts(2)环境搭建

Struts2概述 在Struts的官方网站上,写着下面两段话: Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining

Struts和SpringMVC两种MVC框架比较

基于Web的MVC framework在J2EE的世界内已是空前繁荣.TTS网站上几乎每隔一两个星期就会有新的MVC框架发布.目前比较好的MVC,老牌的有Struts.Webwork.新兴的MVC框架有Spring MVC.Tapestry.JSF等.这些大多是著名团队的作品,另外还有一些边缘团队的作品,也相当出色,如Dinamica.VRaptor等.这些框架都提供了较好的层次分隔能力.在实现良好的MVC 分隔的基础上,通过提供一些现成的辅助类库,同时也促进了生产效率的提高. 如何选择一个好的

zipkin:HttpClient和struts

因为要和老系统集成zipkin,意外的发现老系统使用的httpClient来发送信息.zipkin的官方demo可都是retstTemplate啊!有的搞头. 在看Demo的时候意外的发现其实其实2.5是支持httpClient的,只有到了spring 3之后才是restTemplate:但是我移植到了struts工程之后发现@Autowired的httpClient返回的是NULL: 原来因为在spring的配置文件中的扫描路径有问题.但是改了路径依然没好,这是怎么回事:后来才发现原来报错的是

How to enable C development in a Windows 10 development environment VM

To enable C development in a Windows 10 development environment VM, follow these steps: Start VS in the Windows 10 development environment VM. Choose "File" -> "New" -> "Project", choose "Open Visual Studio Install

struts(IDEA)的应用

目标 任务,完成以上功能. 第一步:模拟组长建project 1.建立一个空白工程(里面是没有文件的) 2.到此,我们见到新建的工程,目录里面没有其他文件,只有.idea目录 (这个是相关配置信息,可以不管它) 3.点击托管项目到码云 4. 输入账号和密码 注意:这里是直接创建远程仓库(在码云的服务器创建,不是本地) 作用:把本地的代码,统统托管到服务器上 5. 提示提交文件,但是没有文件可以提交,因为本项目本来就是空. 6.右下角,提示创建仓库成功. 同时,仓库里面,什么代码代码都没有 8.按

单细胞文章分享:Molecular Diversity of Midbrain Development in Mouse, Human, and Stem Cells

Molecular Diversity of Midbrain Development in Mouse, Human, and Stem Cells 本文作者的官网:Ventral midbrain 顺便找到了:Download all the data and Python Notebooks from GitHub to reproduce the main figures. GitHub:linnarsson-lab/ipynb-lamanno2016 教程:scRNA-Seq Data