You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

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

As of WebWork 2.2, Velocity support in WebWork has been deprecated. Many of the new 2.2 features were not built for Velocity, and moving forward Velocity support may be removed entirely. We highly recommend you look at FreeMarker.

Syntax

For example, in JSP you might create a form like so:

<ww:form action="updatePerson">
    <ww:textfield label="First name" name="firstName"/>
    <ww:submit value="Update"/>
</ww:form>

In Velocity the same form is built like so:

#wwform ("action=updatePerson")
    #wwtextfield ("label=First name" "name="firstName")
    #wwsubmit ("value=Update")
#end

Block and Inline Tags

You may notice that some tags require an #end statement, while others do not. Due to a limitation in Velocity, 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.

  • No labels