@TagLib class ValidationTagLib extends java.lang.Object
Tags to handle validation and errors.
Type | Name and description |
---|---|
static java.lang.Object |
CONSTRAINT_TYPE_MAP |
CodecLookup |
codecLookup |
groovy.lang.Closure |
eachError Loops through each error of the specified bean or model. |
groovy.lang.Closure |
fieldError Renders an error message for the given bean and field. |
groovy.lang.Closure |
fieldValue Obtains the value of a field either from the original errors. |
groovy.lang.Closure |
hasErrors Checks if the request has errors either for a field or global errors. |
groovy.lang.Closure |
message Resolves a message code for a given error or code from the resource bundle. |
org.springframework.context.MessageSource |
messageSource |
groovy.lang.Closure |
renderErrors Loops through each error and renders it using one of the supported mechanisms (defaults to "list" if unsupported). |
static java.lang.Object |
returnObjectForTags |
groovy.lang.Closure |
validate Validates a form using Apache commons validator javascript against constraints defined in a Grails domain class. |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.Object |
eachErrorInternal(java.lang.Object attrs, java.lang.Object body, boolean outputResult = false) |
|
java.lang.Object |
eachErrorInternalForList(java.lang.Object attrs, java.lang.Object errorsList, java.lang.Object body, boolean outputResult = false) |
|
java.lang.Object |
extractErrors(java.lang.Object attrs) |
|
java.lang.Object |
formatValue(java.lang.Object value, java.lang.String propertyPath = null, java.lang.Boolean tagSyntaxCall = false) Formats a given value for output to an HTML page by converting it to a string and encoding it. |
|
java.lang.Object |
messageImpl(java.util.Map attrs) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Loops through each error of the specified bean or model. If no arguments are specified it will go through all model attributes and check for errors.
Renders an error message for the given bean and field.
eg. <g:fieldError bean="${book}" field="title" />
Obtains the value of a field either from the original errors.
eg. <g:fieldValue bean="${book}" field="title" />
Checks if the request has errors either for a field or global errors.
Resolves a message code for a given error or code from the resource bundle.
Loops through each error and renders it using one of the supported mechanisms (defaults to "list" if unsupported).
Validates a form using Apache commons validator javascript against constraints defined in a Grails
domain class.
TODO: This tag is a work in progress
Formats a given value for output to an HTML page by converting it to a string and encoding it. If the value is a number, it is formatted according to the current user's locale during the conversion to a string.