Can Bean Validation be applied to method parameters in Spring Boot, and if so, how?

  • No, Bean Validation can only be applied to class-level fields.
  • Yes, by annotating the method parameters with validation annotations like @Valid.
  • Yes, by creating a custom validation aspect and applying it to the methods that need validation.
  • Yes, by enabling the spring.validation.method property in the application.properties file.
Bean Validation can be applied to method parameters in Spring Boot by annotating the method parameters with validation annotations such as @Valid. This allows you to validate the input parameters of a method and apply validation rules to them.
Add your answer
Loading...

Leave a comment

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