• RubyonRails
  • jQuery
  • JSP
  • Spring
  • Servlet
  • Java IO
  • JavaScript
  • PHP
  • Core Java

  • <

    JSF Validation <f:validateBean> Tag

    It is used to register a bean validator to the component. For validating bean model, you must set the context parameter in the web deployment descriptor file web.xml.


    Bean Validation Constraints

    JSF provides validation constraints for bean model in the form of annotations. You can place that annotations on a field, method, or class of a JavaBeans component, such as a managed bean.

    JSF also provides facility to create custom or user defined constraints.

    Built-In Bean Validation Constraints



    Constraint Description
    @NotNull It is used to set not null constraint to the value of the field or property.
    @Null It is used set null constraint to the value of the field or property.
    @Size It is used to specify size of field or property. The size of the field or property is evaluated and must match the specified boundaries. Use one of the optional max or min elements to specify the boundaries.
    @Digits It is used to set constraint that the value of the field or property must be a number within a specified range. The integer element specifies the maximum integral digits for the number, and the fraction element specifies the maximum fractional digits for the number.
    @DecimalMin This constraint specifies that the value of the field or property must be a decimal value greater than or equal to the number in the value element.
    @DecimalMax It is used to specify that the value of the field or property must be a decimal value lower than or equal to the number in the value element.
    @Max It is used to set the value of the field or property which must be an integer value lower than or equal to the number in the value element.
    @Min It is used to set the value of the field or property which must be an integer value greater than or equal to the number in the value element.
    @Pattern It is used to set patter which must match the regular expression defined in the regexp element.
    @Past It is used to set the value of the field or property which must be a date in the past.
    @Future It is used to set the value of the field or property which must be a date in the future.
    @AssertTrue It is used to set the value of the field or property which must be true.
    @AssertFalse It is used to set the value of the field or property which must be false.















    © copyright 2017-2021 Completedone pvt ltd.