[
http://issues.apache.org/jira/browse/MYFACES-1467?page=comments#action_12442593
]
David Chandler commented on MYFACES-1467:
-----------------------------------------
Thanks everyone for your contributions.
If I may summarize Craig's comments, skipping validation for a null value is a
good thing, whereas skipping requiredness check for a null value is not.
Correct?
Adam, the approach of fixing it only in h:inputText renderer gives me concern
because it leaves this issue hanging for any custom components people write
(and possibly others of the base components). You can use an MITM proxy to wipe
a submitted value for any component, not just h:inputText. Therefore, I'd
really rather fix it in UIInput once for all. Can you elaborate on your
concerns with this approach?
As to a cross-field validation "framework", I have successfully used the
approach of creating a component <my:formValidator validator="id or
bean.method">. You put it as the last field in a form, and the component
internally does a setSubmittedValue("NO_OP") so as to force the validation
method specified in the attribute to run. I'd be happy to contribute my 3-line
component to Tomahawk if desired :-)
> Validation doesn't run for required fields if submitted value is null
> ---------------------------------------------------------------------
>
> Key: MYFACES-1467
> URL: http://issues.apache.org/jira/browse/MYFACES-1467
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 1.1.5-SNAPSHOT, 1.2.0-SNAPSHOT
> Reporter: David Chandler
> Assigned To: Matthias Weßendorf
> Attachments: patch.txt
>
>
> A component with a required value will not fail validation as expected if the
> submitted value is null. This issue is not seen normally because browsers
> send the value for an empty text field as an empty string. That is, the POST
> data for an empty field1 will contain the field name but no value, like
> field1=&field2=something. However, if you use a man-in-the-middle proxy such
> as Paros to remove "fieldname=" from the POST data, the submitted value will
> be null. UIInput.validate() skips validation for null submitted values, but
> since requiredness is also part of validation, the requiredness check gets
> skipped, too.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira