webtier@glassfish.java.net

Re: [webtier] JSF2 Validation Behavior?

From: <lincolnbaxter_at_gmail.com>
Date: Mon, 31 Aug 2009 15:44:30 +0000

I think its defaulting to true for me.

Ill have to double check when I get back, though. I haven't added that param or bean Validations to my project.
Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>

Date: Mon, 31 Aug 2009 08:31:14
To: <webtier_at_glassfish.dev.java.net>
Subject: Re: [webtier] JSF2 Validation Behavior?

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