使用注解对前端返回的Json进行非空验证
1.前端返回的Json串{
"studentId":"",
"studentName":""
}2.使用Student类来接收属性private String studentId;
private String studentName;
省略setget方法、、、3.为了限制studentId和studentName属性不为空需要在Student类中添加注解,引用的包//引用的包
i
原创
2016-12-18 20:39:21 ·
2591 阅读 ·
0 评论