Versions Compared

Key

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

Update formatting and nomenclature

Velocity tags are extensions of the generic Tags provided by WebWorkthe framework. You can get started almost immediately by simply jump right in just by knowing the structure in which the tags can be accessed: #ww#safxxx (...) ... #end, where xxx is any of the Tags supported by WebWork.

Note

As of WebWork 2.2, the use of Velocity for templating internal WebWork UI Tags have been removed. The new and legacy 2.2 UI tags have been implemented in FreeMarker. However, support for the Velocity result type as well as the Velocity directives shown below will continue to be supported and developed. By default, WebWork's TemplateEngine will call the FreeMarker UI Tags using the Velocity syntax noted below (through Velocity directives). See Template Loading for more information.

Syntax

the framework.

For example, in JSP you might create a form like so:using SAF tags.

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

In Velocity, the same form is built like so:can also be built using SAF macros.

Code Block
xml
xml
titleVM Form
#wwform#safform ("action=updatePerson")
    #wwtextfield#saftextfield ("label=First name" "name=firstName")
    #wwsubmit#safsubmit ("value=Update")
#end

Block and Inline Tags

You may notice that some Some VM tags require an #end statement , while others do not. Due to The inconsistency arises from a limitation in Velocity , where tags must declare if they are a block or inline tag up front. As such, by default all tags are inline except for a few key ones, such as the form tag. We strongly encourage you to look at FreeMarker, which provides much better flexibility in this area as well as others

Tip

The FreeMarker tags offer a consistent syntax, along with additional features and improved error management.