-
Notifications
You must be signed in to change notification settings - Fork 107
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
@NotNull for f:viewParam is not triggered when the parameter is missing in the query string #3343
Comments
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented So, instead of the current UIViewParam#processValidators() implementation as it is in Mojarra 2.2.7, starting at line number 259
The current and all previous problems can be solved as follows, whereby the standard UIInput validation is fully utilized, including f:validateRequired and @NotNull:
The average developer would anyway already use javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL=true to prevent the model being polluted with empty string. |
@javaserverfaces Commented Thank you for the writeup, I want to ask for a bit of clarification, what needs to happen when javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is set to false? Also can you roll up a minimal example for this and send it to issues@javaserverfaces.java.net? Thanks! |
@javaserverfaces Commented
Set submitted and local value back to null. You could do this after super.processValidators(context) call, only if the submitted value was originally null. |
@javaserverfaces Commented |
@javaserverfaces Commented |
1 similar comment
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
|
@NotNull bean validation isn't being considered for <f:viewParam> whereas its own required="true" and a nested <f:validateRequired> (as per issue 3058) are correctly being considered.
I'd expect the @NotNull also being considered the same way.
Affected Versions
[2.2.7]
The text was updated successfully, but these errors were encountered: