webtier@glassfish.java.net

Re: [webtier] JSF2 Validation Behavior?

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 31 Aug 2009 08:31:14 -0700

On 8/30/09 11:11 AM, Lincoln Baxter, III wrote:
> If I am remembering correctly, validators do not fire for empty fields
> on form submission. I'm currently seeing behavior in the latest
> snapshot where validators are indeed firing on empty fields.
>
> Is this intended? I seem to recall discussion about this some time
> ago, but can't find it.
>
> Is there a behavior toggle switch? What am I missing?
There's a context init parameter called 'javax.faces.VALIDATE_EMPTY_FIELDS'.
The value will default to false *unless* the Beans Validation API is
present in which case the value will be set to true (if not
already explicitly set).

See UIInput#valdiateValue(FacesContext,Object) for details.
>
> --Thanks,
> Lincoln