Stripes Tag Library
Tag errors
Outputs validation errors. If an action attribute is specified, will only render errors if
the submitted form action matches the specified one. Otherwise, if nested inside a
stripes form tag, will only display errors if they are for the enclosing form. Otherwise
will display errors for whatever form was submitted. Can optionally take a field name
to limit output to a single field's errors.
By default will output a simple header followed by a list of validation errors in an
HTML unordered list. This behaviour can be customized in two ways. The first will
affect the default output of the errors tag on all pages within the application. The
errors tag will consult the error messages resource bundle (probably
StripesResources.properties unless you have configured it differently) for four String
resources which it will use to construct the output. The four properties, and their
default values are:
- stripes.errors.header=<div class="errorHeader">Validation Errors</div><ul>
- stripes.errors.footer=</ul>
- stripes.errors.beforeError=<li>
- stripes.errors.afterError=</li>
The second way to customize the output affects only the output on a specific page.
The nestable tags are: stripes:individual-error, stripes:error-header and
stripes:error-footer. An example, re-creating the default output using this
technique follow:
<stripes:errors>
<stripes:errors-header><div class="errorHeader">Validation Errors</div><ul></stripes:errors-header>
<li><stripes:individual-error/></li>
<stripes:errors-footer></ul></stripes:errors-footer>
</stripes:errors>
| Tag Information |
| Tag Class | net.sourceforge.stripes.tag.ErrorsTag |
| TagExtraInfo Class | net.sourceforge.stripes.tag.ErrorsTagExtraInfo |
| Body Content | JSP |
| Display Name | errors |
| Attributes |
| Name | Required | Request-time | Type | Description |
| action | false | true | java.lang.String |
If supplied, the errors tag will only output errors for a form that posted to the
supplied action path. Can be used when there are multiple forms on the page and
you wish to display errors in different places for each form, but not necessarily
inside of the form tags.
|
| field | false | true | java.lang.String |
If supplied, the errors tag will only output errors associated with the
named field.
|
| Variables |
No Variables Defined. |
Output Generated by
Tag Library Documentation Generator.
Java, JSP, and JavaServer Pages are trademarks or
registered trademarks of Sun Microsystems, Inc. in the US and other
countries. Copyright 2002-4 Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054, U.S.A.
All Rights Reserved.