mojarra icon indicating copy to clipboard operation
mojarra copied to clipboard

Required validator not performed on unsubmitted value

Open prince-jn opened this issue 6 years ago • 1 comments

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

prince-jn avatar May 05 '18 15:05 prince-jn

Please create a http://stackoverflow.com/help/mcve

kukel avatar May 31 '18 14:05 kukel