1. 基于 JSR-303(一个数据验证的规范): import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.NotBlank; public class User { private String username; private String password; private int age