Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
spring boot 中是否有任何注释可以检查 json request 中字段的 null 和空格。到目前为止,我已经向字段添加了 @NotNull 注释,它适用于空值,但如果我添加空格或制表符,它会成功。有没有办法检查它们
就在这里:@NotBlank
@NotBlank
看这里:
https://docs.jboss.org/hibernate/stable/beanvalidation/api/javax/validation/constraints/NotBlank.html