Versions Compared

Key

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

FreeMarker tags are extensions of the generic Tags provided by the framework. You can jump right in just by knowing the generic structure in which the tags can be accessed: <@s.xxx> tag> ...</@s.xxx>tag>, where xxx tag is any of the tags supported by the framework.

For example, in JSP you might create a form using SAF Struts tags.

Code Block
xml
xml
titleJSP Form
<s:form action="updatePerson">
    <saf<s:textfield label="First name" name="firstName"/>
    <saf<s:submit value="Update"/>
</s:form>

In FreeMarker the same form can also be built using SAF Struts tags.

Code Block
xml
xml
titleFTL Form
<@s.form action="updatePerson">
    <@s.textfield label="First name" name="firstName"/>
    <@s.submit value="Update"/>
</@s.form>

...

Aside from doing everything that the JSP tags do, the FTL tags boast some advanced additional features that you can use to make your pages even easier to code. You can even invoke third-party JSP taglibs as if there were native FTL tags.

...

While the framework provides native FreeMarker Tags, you might wish to use other third-party tags that are only available for JSP. Fortunately, FreeMarker has the ability to run JSP tags. To do so, you must include the JspSupportServlet in the application's web.xml, as this allows the FreeMarker integration to get access to the required objects needed to emulate a JSP taglib container.

...