Versions Compared

Key

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

...

See also: Freemarker configuration properties

(warning)

...

Enable Freemarker template caching

As of Struts 2.0.10, setting the property struts.freemarker.templatesCache to true will enable the Struts internal caching of Freemarker templates. This property is set to false by default.

In Struts versions prior to 2.0.10, you had to copy the /template directory from the Struts 2 jar in your WEB_APP root to utilize Freemarker's built in chaching mechanism in order to achieve similar results.

The built in Freemarker caching mechanism fails to properly cache templates when they are retrieved from the classpath. Copying them to the WEB_APP root allows Freemarker to cache them correctly. Freemarker looks at the last modified time of the template to determine if it needs to reload the templates. Resources retrieved from the classpath have no last modified time, so Freemarker will reload them on every request.

...

titleStruts 2.1 Only

...

.

...

(warning) When overriding a theme, copy all necessary templates to the theme directory.

...