Package jakarta.faces.validator
Class RequiredValidator
java.lang.Object
jakarta.faces.validator.RequiredValidator
- All Implemented Interfaces:
Validator,EventListener
A Validator that checks for an empty value in the same way that UIInput checks for a value. In fact, this validator is equivalent to setting the required attribute on the input component to true.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe standard converter id for this converter.Fields inherited from interface jakarta.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(FacesContext context, UIComponent component, Object value) Verify that the converted object value is not null.
-
Field Details
-
VALIDATOR_ID
The standard converter id for this converter.
- See Also:
-
-
Constructor Details
-
RequiredValidator
public RequiredValidator()
-
-
Method Details
-
validate
Verify that the converted object value is not null.
- Specified by:
validatein interfaceValidator- Parameters:
context- FacesContext for the request we are processingcomponent- UIComponent we are checking for correctnessvalue- the value to validate- Throws:
ValidatorException- if validation fails
-