JSF core tag library.
Tag validateRegex
RegexValidator is a {@link javax.faces.validator.Validator} that checks the value of the corresponding component against specified pattern using Java regular expression syntax. The regular expression syntax accepted by the RegexValidator class is same as mentioned in class {@link java.util.regex.Pattern} in package java.util.regex
.
The following algorithm is implemented:
- If the passed value is
null
, exit immediately. - If the passed value is not a String, exit with a {@link #NOT_MATCHED_MESSAGE_ID} error message.
- If no pattern has been set, or pattern resolves to
null
or an empty String, throw a {@link javax.faces.validator.ValidatorException} with a {@link #PATTERN_NOT_SET_MESSAGE_ID} message. - If pattern is set, but is not of type String, throw a {@link javax.faces.validator.ValidatorException} with a {@link #NOT_STRING_MESSAGE_ID} message.
- If pattern is not a valid regular expression, according to the rules as defined in class {@link java.util.regex.Pattern}, throw a {@link ValidatorException} with a (@link #MATCH_EXCEPTION_MESSAGE_ID} message.
- If a
pattern
property has been configured on this {@link javax.faces.validator.Validator}, check the passed value against this pattern. If value does not match pattern throw a {@link ValidatorException} containing a {@link #NOT_MATCHED_MESSAGE_ID} message.
Tag Information |
Tag Class | org.apache.myfaces.taglib.core.ValidateRegexTag |
TagExtraInfo Class | None |
Body Content | empty |
Display Name | None |
Attributes |
Name | Required | Request-time | Type | Description |
pattern | true | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Return the ValueExpression that yields the regular expression pattern when evaluated. |
binding | false | false | javax.el.ValueExpression
(must evaluate to javax.faces.validator.RegexValidator )
| A ValueExpression that evaluates to a RegexValidator. |
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.