You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
740 lines
27 KiB
740 lines
27 KiB
<?xml version="1.0" encoding="UTF-8"?> |
|
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
|
|
|
<appendix id="spring.tld"> |
|
<title>spring.tld</title> |
|
<section id="spring.tld-intro"> |
|
<title>Introduction</title> |
|
</section> |
|
<para>One of the view technologies you can use with the Spring Framework |
|
is Java Server Pages (JSPs). To help you implement views using Java Server Pages |
|
the Spring Framework provides you with some tags for evaluating errors, setting |
|
themes and outputting internationalized messages.</para> |
|
<para>Please note that the various tags generated by this form tag library |
|
are compliant with the <ulink url="http://www.w3.org/TR/xhtml1/">XHTML-1.0-Strict specification</ulink> and attendant <ulink url="http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict">DTD</ulink>.</para> |
|
<para>This appendix describes the <literal>spring.tld</literal> tag library.</para> |
|
<itemizedlist> |
|
<listitem> |
|
<xref linkend="spring.tld.bind"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.escapeBody"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.hasBindErrors"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.htmlEscape"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.message"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.nestedPath"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.theme"/> |
|
</listitem> |
|
<listitem> |
|
<xref linkend="spring.tld.transform"/> |
|
</listitem> |
|
</itemizedlist> |
|
<section id="spring.tld.bind"> |
|
<title>The <literal>bind</literal> tag</title> |
|
<para> |
|
Provides BindStatus object for the given bind path. |
|
The HTML escaping flag participates in a page-wide or application-wide setting |
|
(i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). |
|
</para> |
|
<table id="spring.tld.bind.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>htmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set HTML escaping for this tag, as boolean value. Overrides |
|
the default HTML escaping setting for the current page.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>ignoreNestedPath</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set whether to ignore a nested path, if any. Default is to not ignore.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>path</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The path to the bean or bean property to bind status |
|
information for. For instance account.name, company.address.zipCode |
|
or just employee. The status object will exported to the page scope, |
|
specifically for this bean or bean property</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.escapeBody"> |
|
<title>The <literal>escapeBody</literal> tag</title> |
|
<para> |
|
Escapes its enclosed body content, applying HTML escaping and/or JavaScript escaping. |
|
The HTML escaping flag participates in a page-wide or application-wide setting |
|
(i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). |
|
</para> |
|
<table id="spring.tld.escapeBody.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>htmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set HTML escaping for this tag, as boolean value. Overrides the |
|
default HTML escaping setting for the current page.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>javaScriptEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set JavaScript escaping for this tag, as boolean value. |
|
Default is false.</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.hasBindErrors"> |
|
<title>The <literal>hasBindErrors</literal> tag</title> |
|
<para> |
|
Provides Errors instance in case of bind errors. |
|
The HTML escaping flag participates in a page-wide or application-wide setting |
|
(i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). |
|
</para> |
|
<table id="spring.tld.hasBindErrors.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>htmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set HTML escaping for this tag, as boolean value. |
|
Overrides the default HTML escaping setting for the current page.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>name</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The name of the bean in the request, that needs to be |
|
inspected for errors. If errors are available for this bean, they |
|
will be bound under the 'errors' key.</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.htmlEscape"> |
|
<title>The <literal>htmlEscape</literal> tag</title> |
|
<para> |
|
Sets default HTML escape value for the current page. |
|
Overrides a "defaultHtmlEscape" context-param in web.xml, if any. |
|
</para> |
|
<table id="spring.tld.htmlEscape.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>defaultHtmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set the default value for HTML escaping, to be put |
|
into the current PageContext.</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.message"> |
|
<title>The <literal>message</literal> tag</title> |
|
<para> |
|
Retrieves the message with the given code, or text if code isn't resolvable. |
|
The HTML escaping flag participates in a page-wide or application-wide setting |
|
(i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). |
|
</para> |
|
<table id="spring.tld.message.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>arguments</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set optional message arguments for this tag, as a |
|
(comma-)delimited String (each String argument can contain JSP EL), |
|
an Object array (used as argument array), or a single Object (used |
|
as single argument).</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>argumentSeparator</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The separator character to be used for splitting the |
|
arguments string value; defaults to a 'comma' (',').</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>code</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The code (key) to use when looking up the message. |
|
If code is not provided, the text attribute will be used.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>htmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set HTML escaping for this tag, as boolean value. |
|
Overrides the default HTML escaping setting for the current page.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>javaScriptEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set JavaScript escaping for this tag, as boolean value. Default is false.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>message</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>A MessageSourceResolvable argument (direct or through JSP EL). |
|
Fits nicely when used in conjunction with Spring's own validation error |
|
classes which all implement the MessageSourceResolvable interface. For |
|
example, this allows you to iterate over all of the errors in a form, |
|
passing each error (using a runtime expression) as the value of this |
|
'message' attribute, thus effecting the easy display of such error |
|
messages.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>scope</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The scope to use when exporting the result to a variable. |
|
This attribute is only used when var is also set. Possible values are |
|
page, request, session and application.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>text</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Default text to output when a message for the given code |
|
could not be found. If both text and code are not set, the tag will |
|
output null.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>var</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The string to use when binding the result to the page, |
|
request, session or application scope. If not specified, the result |
|
gets outputted to the writer (i.e. typically directly to the JSP).</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.nestedPath"> |
|
<title>The <literal>nestedPath</literal> tag</title> |
|
<para> |
|
Sets a nested path to be used by the bind tag's path. |
|
</para> |
|
<table id="spring.tld.nestedPath.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>path</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set the path that this tag should apply. E.g. 'customer' |
|
to allow bind paths like 'address.street' rather than |
|
'customer.address.street'.</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.theme"> |
|
<title>The <literal>theme</literal> tag</title> |
|
<para> |
|
Retrieves the theme message with the given code, or text if code isn't resolvable. |
|
The HTML escaping flag participates in a page-wide or application-wide setting |
|
(i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). |
|
</para> |
|
<table id="spring.tld.theme.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>arguments</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set optional message arguments for this tag, as a |
|
(comma-)delimited String (each String argument can contain JSP EL), |
|
an Object array (used as argument array), or a single Object (used |
|
as single argument).</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>argumentSeparator</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The separator character to be used for splitting the |
|
arguments string value; defaults to a 'comma' (',').</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>code</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The code (key) to use when looking up the message. |
|
If code is not provided, the text attribute will be used.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>htmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set HTML escaping for this tag, as boolean value. |
|
Overrides the default HTML escaping setting for the current page.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>javaScriptEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set JavaScript escaping for this tag, as boolean value. Default is false.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>message</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>A MessageSourceResolvable argument (direct or through JSP EL).</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>scope</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The scope to use when exporting the result to a variable. |
|
This attribute is only used when var is also set. Possible values are |
|
page, request, session and application.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>text</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Default text to output when a message for the given code |
|
could not be found. If both text and code are not set, the tag will |
|
output null.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>var</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The string to use when binding the result to the page, |
|
request, session or application scope. If not specified, the result |
|
gets outputted to the writer (i.e. typically directly to the JSP).</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
<section id="spring.tld.transform"> |
|
<title>The <literal>transform</literal> tag</title> |
|
<para> |
|
Provides transformation of variables to Strings, using an appropriate |
|
custom PropertyEditor from BindTag (can only be used inside BindTag). |
|
The HTML escaping flag participates in a page-wide or application-wide setting |
|
(i.e. by HtmlEscapeTag or a 'defaultHtmlEscape' context-param in web.xml). |
|
</para> |
|
<table id="spring.tld.transform.table"> |
|
<title>Attributes</title> |
|
<tgroup cols="3"> |
|
<colspec align="center" colname="Attribute"/> |
|
<colspec align="center" colname="Required"/> |
|
<colspec align="center" colname="Runtime.Expression"/> |
|
<colspec align="left" colname="Description"/> |
|
<thead> |
|
<row> |
|
<entry align="center">Attribute</entry> |
|
<entry align="center">Required?</entry> |
|
<entry align="center">Runtime Expression?</entry> |
|
<entry align="left">Description</entry> |
|
</row> |
|
</thead> |
|
<tbody> |
|
<row> |
|
<entry> |
|
<para>htmlEscape</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>Set HTML escaping for this tag, as boolean value. Overrides |
|
the default HTML escaping setting for the current page.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>scope</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The scope to use when exported the result to a variable. |
|
This attribute is only used when var is also set. Possible values are |
|
page, request, session and application.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>value</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The value to transform. This is the actual object you want |
|
to have transformed (for instance a Date). Using the PropertyEditor that |
|
is currently in use by the 'spring:bind' tag.</para> |
|
</entry> |
|
</row> |
|
<row> |
|
<entry> |
|
<para>var</para> |
|
</entry> |
|
<entry> |
|
<para>false</para> |
|
</entry> |
|
<entry> |
|
<para>true</para> |
|
</entry> |
|
<entry> |
|
<para>The string to use when binding the result to the page, |
|
request, session or application scope. If not specified, the result gets |
|
outputted to the writer (i.e. typically directly to the JSP).</para> |
|
</entry> |
|
</row> |
|
</tbody> |
|
</tgroup> |
|
</table> |
|
</section> |
|
</appendix>
|
|
|