Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

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

...

Code Block
xml
xml
<@s.select label="Foo label - ${foo}" name="${name}" list=[1, 2, 3]/>

Wiki MarkupNotice that the list attribute no longer has quotes around it. Now it will come in to the tag as an object that can't easily be converted to a String. Normally, the tag would just call {{toString}}, which would return "\[1, 2, 3\]" and be unable to be converted back to a List by OGNL. Rather than go through all this back and forth, the frameworks's FreeMarker tag support will recognize collections and not pass them through the normal tag attribute. Instead, the framework will set them directly in the {{parameters}} Map, ready to be consumed by the template.

In the end, everything tends to do what you would expect, but it can help to understand the difference of when OGNL is being used and when it isn't, and how attribute types get converted.

...

Code Block
xml
xml
titleAdding JspSupportSerlvet to web.xml
<servlet>
    <servlet-name>JspSupportServlet</servlet-name>
    <servlet-class>comclass>org.opensymphonyapache.webworkstruts2.views.JspSupportServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

...

Code Block
xml
xml
<#assign cewolf=JspTaglibs["/WEB-INF/cewolf.tld"] />
...
<@cewold.xxx ... />

Next: Velocity