Struts 2 development mode configuration

Struts 2 development mode configuration

If you are working on Struts 2 application you could use setting development mode ( devmode) true or false. When you set this property struts 2 provide extra debug and logging information which can be speed up your development because it helps to find issue.

What it does:

By default development mode is disabled when you enabled it reload resource bundle on every request. It means when you are working on development environment and changed your properties files you could see the changes in next request. It also reloads XML configuration files ex: struts.xml, validation rules files including other XML configuration files.

How can you make it enable:
You can declare it in multiple files and struts frameworks search it in following order:

  • struts-default.xml
  • struts-plugin.xml
  • struts.xml
  • web.xml

Sample settings:

  • web.xml:
  • struts.xml file:
  <constant name="struts.devMode" value="true" />
  • file:
struts.devMode = true

For more information please read this tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

I am not Robot *