Versions Compared

Key

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

...

Templates, by default, are always FreeMarker templates and are loaded the same way other FreeMarker templates (such as your results) are: by first searching the web application and then the classpath.

Template and Themes

Templates are loaded based on the theme (see Selecting Themes) and the template directory. The template directory is defined by the webwork.ui.templateDir property in webwork.properties (defaults to template). This means, by default, if a tag is using the ajax theme, the following two locations will be searched (in this order):

  1. In the web app: /template/ajax/template.ftl
  2. In the classpath: /template/ajax/template.ftl

Overriding Templates

Because most of the templates you will need are included in the WebWork jar (the classpath), you may find a few situations where you need to override a particular template to provide behavior that is unique to your application. For example, you might wish to change how select tags render. Rather than creating a brand new template and changing every tag to use that template, you can override the built in select.ftl template by copying the file from in the jar over to a new /template/xhtml/select.ftl directory.

...