Project Documentation
Foundation

Summary

Tag name: <s:validateCSV>
Validator class: org.apache.myfaces.custom.csvvalidator.CSVValidator
Tag class: org.apache.myfaces.custom.csvvalidator.ValidateCSVTag
validator id: org.apache.myfaces.validator.csv
Validation by validating comma separated values individually.

Usage

<f:verbatim>enter credit card numbers, separated by a period:</f:verbatim>
            <h:inputText id="creditCardNumber" value="#{backingBean.creditCardNumbers}" required="true">
                <s:validateCSV subvalidatorId="org.apache.myfaces.validator.CreditCard" separator="\\." />
            </h:inputText>

Instructions

Use this validator to allow users to enter multiple input values in a single input, separated by a comma, semicolon, or other custom separator. The CSVValidator will separate the input values and call the subvalidator for each of those values.

See "myfaces-example-sandbox/validatecsv.jsp" for an example.

Known issues

The separator, if specified, must be a valid regex for separating the input String, eq "\\."

Parameters cannot be passed.

Attributes

Name Type Supports EL? Description
detailMessage String Yes alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively)
message String Yes alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively)
separator String No
subvalidatorId String Yes
summaryMessage String Yes alternate validation error summary message format string