首页 > 其他 > 详细

NumberFormat注解 DateTimeFormat

时间:2017-08-27 17:46:23      阅读:718      评论:0      收藏:0      [点我收藏+]
public class Student {
    private String name;
    private Integer gender;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date birth;
    @NumberFormat(pattern="#,###")
    private Integer salary;
    

    public Student(String name, Integer gender, Date birth, Integer salary) {
        super();
        this.name = name;
        this.gender = gender;
        this.birth = birth;
        this.salary = salary;
    }
}

在提交时就可以时间格式写成这样

技术分享

工资写成这样:

技术分享

 

NumberFormat注解 DateTimeFormat

原文:http://www.cnblogs.com/xuesheng/p/7440746.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!