Which annotation is primarily used to declare a field to be validated using JSR-303 Bean Validation?

  • @Assert
  • @NotNull
  • @Valid
  • @Validate
The primary annotation used to declare a field to be validated using JSR-303 Bean Validation is @NotNull. This annotation specifies that a field must not be null, and it is commonly used to validate input parameters or form fields to ensure they have values. The other annotations mentioned have different purposes and are not typically used for field validation.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *