On Feb 16, 2009, at 2:56 PM, babus_18 wrote:


Hi,

I am using jsf api and impl 1.2._12.

I have the following facelet mark up:

<h:inputText id="testInput" value="#{testController.test}" required="false">
 <f:validator validatorId="stateValidator"/>
</h:inputText>

The "stateValidator" is configured as follows in faces-config

<validator>
 <validator-id>stateValidator</validator-id>

<validator-class>adc.validators.MultiFieldLengthValidator</validator- class>
</validator>

The validator is getting invoked with no issues when the value of the field is anything other than "". But when the value is "", the validator does not
get invoked.

I am wondering if I am doing something wrong. Please advise on potential
solutions.

Babu,
I'm no subject matter expert (and from your version number, I'm not sure you're actually using "Geronimo"), but believe that you are describing the expected behavior when "required="false". If required is false, validators are not executed for a null or empty string.

--kevan

Reply via email to