Tag reference sheet
Tag library reference for the following tag libraries:
- Myfaces Commons Validator Tag Library 1.1. (mcv.tld) - uri: http://myfaces.apache.org/commons/validators
Myfaces Commons Validator Tag Library 1.1.
MyFaces subproject that contains validator to be used with any JSF 1.1 implementation.
This is version 1.0.
- validateCSV Validation by validating comma separated values individually
- validateCompareTo Validates this component against another component
- validateCreditCard A custom validator for creditCards, based upon Jakarta Commons
- validateEmail A custom validator for email address format, based upons Jakarta Commons
- validateISBN A custom validator for isbn codes, based upons Jakarta Commons
- validateRegExpr A custom validator for reg
- validateUrl A custom validator for url format, based upons Jakarta Commons
Required attributes are marked with a *
<mcv:validateCSV>
Validation by validating comma separated values individually.
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
separator | String | |
subvalidatorId | String | |
summaryMessage | alternate validation error summary message format string | String |
<mcv:validateCompareTo>
Validates this component against another component. <p> Specify the foreign component with the for={foreign-component-id} attribute. </p> <p> Valid operator attribute values: </p> <ul> <li>equals: eq, ==, =,</li> <li>not equals: ne, !=,</li> <li>greater than: gt, >,</li> <li>less than: lt, <,</li> <li>greater than or equals: ge, >=,</li> <li>less than or equals: le, <=</li> </ul> <p> If the comparator attribute is specified, the component values are compared using the specified java.util.Comparator object. If no comparator is specified, the component values must implement Comparable and are compared using compareTo(). If either value or foreign value does not implement Comparable and no Comparator is specified, validation always succeeds. </p> <p> Put this validator on the bottom-most component to insure that the foreign component's value has been converted and validated first. </p> <p> However, this validator will attempt to convert and validate the foreign component's value if this has not already occurred. This process may not be identical to the standard JSF conversion and validation process. </p><p> The validation error message key is currently hardcoded as </p> <p> "{0} value <{1}> must be {2} {3} value <{4}>" </p> where <ul> <li>{0} is the parent component id,</li> <li>{1} is the parent component value,</li> <li>{2} is the operator name,</li> <li>{3} is the foreign component id, and</li> <li>{4} is the foreign component value.</li> </ul> <p> The alternateOperatorName attribute can specify a custom operator name. For example, use "after" instead of "greater than" when comparing dates. The message attribute can specify an alternate validation error message key. For example, use "{0} must be {2} {3}" to remove values from the message. </p> <p> Known issues: </p> <ul> <li> Operator names should be localized.</li> <li> The default message key should be localized.</li> <li> Perhaps an exception should be thrown if the two values are not Comparable and no Comparator is specified.</li> </ul>
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
alternateOperatorName | custom operator name in error message (ie "after" instead of "greater than" for dates) | String |
comparator | Value binding for an alternate java.util.Comparator object if component values don't implement Comparable | String |
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
for | The JSF id of the component with which to compare values. | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
operator | Operator for comparison: equals: eq, ==, =, not equals: ne, !=, greater than: gt, >, less than: lt, <, greater than or equals: ge, >=, less than or equals: le, <= | String |
summaryMessage | alternate validation error summary message format string | String |
<mcv:validateCreditCard>
A custom validator for creditCards, based upon Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
amex | american express cards | String |
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
discover | validation for discover | String |
mastercard | validation for mastercard | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
none | none of the given cardtypes is allowed. | String |
summaryMessage | alternate validation error summary message format string | String |
visa | validation for visa | String |
<mcv:validateEmail>
A custom validator for email address format, based upons Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions.
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
summaryMessage | alternate validation error summary message format string | String |
<mcv:validateISBN>
A custom validator for isbn codes, based upons Jakarta Commons.
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
summaryMessage | alternate validation error summary message format string | String |
<mcv:validateRegExpr>
A custom validator for reg. expr., based upons Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions.
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
pattern | the pattern, which is the base of the validation | String |
summaryMessage | alternate validation error summary message format string | String |
<mcv:validateUrl>
A custom validator for url format, based upons Jakarta Commons.
Can contain: empty
Attributes
Name | Description | Type |
---|---|---|
allow2Slashes | Allow two slashes in the path component of the URL. | String |
allowAllSchemas | Allows all validly formatted schemes to pass validation instead of supplying a set of valid schemes. | String |
detailMessage | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
message | alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively) | String |
schemes | CSV values that indicates the set of schemes to check this url. If allowAllSchemas = true, the values of this field are ignored. If no schemes are provided, default to this set ("http", "https", "ftp"). | String |
summaryMessage | alternate validation error summary message format string | String |