Versions Compared

Key

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

Velocity tags are extensions of the generic Struts Tags provided by the framework. You can get jump right in just by knowing the structure in which the tags can be accessed: #safxxx #s*tag *(...) ... #end, where xxx tag is any of the Struts Tags supported by the framework.

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

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

In Velocity, the same form can also be built using SAF macros.

Code Block
xml
xml
titleVM Form
#safform#sform ("action=updatePerson")
    #saftextfield#stextfield ("label=First name" "name=firstName")
    #safsubmit#ssubmit ("value=Update")
#end

Block and Inline Tags

Some VM tags require an #end statement while others do not. 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.

...

Back To: Tag Developers Guide