Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated intro about freemarker

...

For more information on FreeMarker itself, please visit the FreeMarker website.

Note

Struts2 itself utilizes FreeMarker templates for its own tags because the engine can load templates from the classpath (unlike JSPs), has strong error reporting, built-in internationalization and powerful macro libraries.

Note

The framework also supports Velocity templates. For a comparison of Velocity vs FreeMarker see hereFreeMarker is very similar to Velocity, as both are template languages that can be used outside of a Servlet container. The framework utilizes FreeMarker because FreeMarker has better error reporting. However, both are good alternatives to JSP.

Getting Started

Getting started with FreeMarker is as simple as ensuring all the dependencies are included in your project's classpath. Typically, the only dependency is freemarker.jar. Other than that, struts-default.xml already configures the FreeMarker Result needed to process your application's templates.

...