[JAVASERVERFACES_SPEC_PUBLIC-934] JSF 2 Compatibility and JSR-303 Created: 31/Jan/11  Updated: 12/Aug/14  Resolved: 12/Aug/14

Status: Resolved
Project: javaserverfaces-spec-public
Component/s: Validation/Conversion
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: rogerk Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive beanvalidatortest.zip    
Status Whiteboard:

size_medium importance_medium


 Description   

I am currently using JSF 2, Facelets 1.1.15 and RichFaces 3.3.3-BETA1. JSR-303
bean validation does not work by default. Apparently JSF does not add
BeanValidator in as a default validator by itself, and it does not recognize:
<application>
<default-validators>
<validator-id>javax.faces.Bean</validator-id>
</default-validators>
<application/>

I created a phase listener that iterates through the component tree and adds
the bean validator to any UIInputs before the process validation phase, which
seems to help partially. However, even with VALIDATE_EMPTY_FIELDS set to true,
empty fields are not validated by the bean validator. I also have
INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL set to true if it matters.

This may seem like something that should be low on the list to fix, but with RF
4 slated for summer at the earliest I think this limitation with worth some
attention.

ADDITIONAL COMMENTS (edburns):

I'm marking this INVALID to get your attention. You mention you are using
Facelets 1.1.15, yet most of the new features in JSF2 depend upon using the
Facelets that is built into JSF2. Am I to understand that you are manually
disabling the facelets built into JSF2 in favor of using your bundled Facelets
1.1.15?

Also, if you could come up with a testcase to attach, I'd really appreciate it.

Your assertion that JSR-303 validation doesn't work is questionable, since we
have automated tests that are currently passing demonstrating that it does
work. Are you running on Glassfish v3? If not, on what container are you
running?

ADDITIONAL COMMENTS (jpleed3)

You have my attention.

Yes, I am using Glassfish v3. Yes, I have the Facelets 2 view handler disabled.
RichFaces 3.3.3 is compatible with JSF 2, but not with Facelets 2. See details
here: http://community.jboss.org/wiki/RichFaces333andJSF20

Personally I would love to switch to Facelets 2, but like I said RF 4 - which
will be compatible with Facelets 2 - is months away.

That said, give me a little while and I'll see if I can come up with something
simple.
[ Show ยป ]
jpleed3 added a comment - 08/Feb/10 01:56 PM You have my attention. Yes, I am using Glassfish v3. Yes, I have the Facelets 2 view handler disabled. RichFaces 3.3.3 is compatible with JSF 2, but not with Facelets 2. See details here: http://community.jboss.org/wiki/RichFaces333andJSF20 Personally I would love to switch to Facelets 2, but like I said RF 4 - which will be compatible with Facelets 2 - is months away. That said, give me a little while and I'll see if I can come up with something simple.

ADDITIONAL COMMENTS (edburns):

For the record, the software stack you are using is not qualified to work with
Bean Validation, so I am going to change the target milestone to 2.0.next.

I will leave the issue open, however and work on it as time permits.

NOTE: Attachment is from jpleed3 illustrating issue.



 Comments   
Comment by Ed Burns [ 01/Aug/14 ]

Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

Generated at Sat Apr 25 11:11:15 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.