配置文件注入值数据校验 JSR303数据校验

JSR303数据校验

@Component
@ConfigurationProperties(prefix = "person")
@Validated
public class Person {
/**
* <bean class="Pers
//lastName必须是邮箱格式
@Email //@Value("${person.last‐name}") private String lastName; //@Value("#{11*2}")
    private Integer age;
    //@Value("true")
    private Boolean boss;
    private Date birth;
    private Map<String,Object> maps;
    private List<Object> lists;
    private Dog dog;
1

猜你喜欢

转载自www.cnblogs.com/guchunchao/p/9854462.html