Pages Navigation Menu

Coding is much easier than you think

Struts 2 – Development Mode Example

Struts 2 – Development Mode Example

 
Struts 2 has a setting which can be set to true or false in struts.properties called devMode. When this setting is enabled, Struts 2 will provide additional logging and debug information, which can significantly speed up development.

 
** UPDATE: Struts 2 Complete tutorial now available here.
 

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>

 
Note :
 
1.By default, the development mode is disabled, because it has a significant impact on performance, since the entire configuration will be reloaded on every request.
 
2. The development mode is only suitable in development or debugging environment. In production environment, you have to disable it. As 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.
 
Do read :

 

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>

 

Reference

  • Struts 2 development mode documentation

 

About Mohaideen Jamil