mojarra
mojarra copied to clipboard
Required validator not performed on unsubmitted value
Not really sure if it's a security hole, a bug or the correct behavior but...
Explanation : I can submit a form without any value submitted and my action is getting invoked.
How : Just use the firefox tools (edit and resend request) and remove your input value.
Code :
public void validate(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// Submitted value == null means "the component was not submitted
// at all".
Object submittedValue = getSubmittedValue();
if (submittedValue == null) {
return;
}
Question : It is normal? How can I enforce the required validation? Thanks
Please create a http://stackoverflow.com/help/mcve