Table 8-2.
Te
mplate Macros Available for Velocity and FreeMarker
Macro Description
Velocity
FreeMarker
bind
#springBind($path) <@spring.bind path>
message
(output a string from
#springMessage($code) <@spring.message code/>
a resource bundle based on the code parameter)messageText
(output a string
#springMessageText($code $default) <@spring.messageText code, default/>
from a resource bundle based on the code parameter, falling back to the value of the default parameter)url
(prefix a relative URL with
#springUrl($relativeUrl) <@spring.url relativeUrl/>
the application’s context root)formInput
(standard input
#springFormInput($path $attributes) <@spring.formInput path, attributes,
field for gathering user input)
fieldType/>
formHiddenInput
* (hidden
#springFormHiddenInput($path $attributes) <@spring.formHiddenInput path,
input field for submitting
attributes/>
non-user input)formPasswordInput
* (standard
#springFormPasswordInput($path $attributes) <@spring.formPasswordInput path,
input field for gathering
attributes/>
passwords; note that no value will ever be populated in fields of this type)formTextarea
(large text field for
#springFormTextarea($path $attributes) <@spring.formTextarea path,
gathering long, freeform text input)
attributes/>
formSingleSelect
(drop-down
#springFormSingleSelect( $path $options $attributes) <@spring.formSingleSelect path,
box of options allowing a single
options, attributes/>
required value to be selected)formMultiSelect
(a list box of
#springFormMultiSelect($path $options $attributes) <@spring.formMultiSelect path,
options allowing the user to
options, attributes/>
select 0 or more values)
(Continued)
CHAPTER 8 ■SUPPORTED VIEW TYPES 243