Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Development Mode (aka "devMode")

Warning

Please turn this option off before deploying application to a production environment - it can expose sensitive data of your application!

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

...

If you experience slow page rendering when devMode is on it's mostly because Freemarker cache is disabled during devMode. You can explicit enable cache and any other options disabled by devMode, see example below:

Code Block
xml
xml

<constant name="struts.devMode" value="true" />
<constant name="struts.i18n.reload" value="false"/>
<constant name="struts.configuration.xml.reload" value="false"/>
<constant name="struts.freemarker.templatesCache" value="true"/>
<constant name="struts.freemarker.templatesCache.updateDelay" value="120"/>
<constant name="struts.freemarker.mru.max.strong.size" value="120"/>

...