-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.0.0: Bean Validation doesn't work in composite components #5171
Comments
Overriding getValueReference is not enough, because later it fails in BeanValidator.isResolvable. |
@NicolaIsotta did you want to submit a PR for review? |
Well I'm not sure bringing back ValueExpressionAnalyzer is the right way, guess they cut it from 4.0 for a good reason? |
Reproduced. I've added an IT. |
Ok, the IT passed but the TCK failed on faces22/cdiMethodValidation .. I'll have to take a second look later. |
Hmm .. it was intermittent .. all tests passed now .. PRs created nonetheless. |
Well, to reduce the overhead of maintaining our own code, in 4.0 we have been replacing code with standard alternatives where available. Maybe we could / should analyse why exactly the standard version doesn't work correctly, and whether that may be a bug in the expression language implementation library or the spec. |
Further improved by adjusting ContextualCompositeValueExpression so we can get rid of the ValueExpressionAnalyzer
@NicolaIsotta has already figured out it. PR has been updated. |
Merged now. |
the ValueExpressionAnalyzer from 3.0
Further improved by adjusting ContextualCompositeValueExpression so we can get rid of the ValueExpressionAnalyzer
Describe the bug
Bean validation is not called for values of composite components.
To Reproduce
myComposite.xhtml:
index.xhtml:
Index.java:
Just press the button to submit the form
NB: I have a reproducer project if needed
Expected behavior
For both inputs validation should be performed. Instead, only the simple input is validated.
Screenshots
Additional context
This seems to be a 4.0.0 regression, using 3.0.2 the validation is performed correctly.
Tried to debug, I found out that here in BeanValidator.validate valueReference is null:
mojarra/impl/src/main/java/jakarta/faces/validator/BeanValidator.java
Lines 304 to 308 in 304a997
Maybe the cause is the missing override of
getValueReference()
incom.sun.faces.facelets.el.ContextualCompositeValueExpression
?The text was updated successfully, but these errors were encountered: