SpringMVC.xml里添加:
<mvc:annotation-driven ></mvc:annotation-driven>
@DateTimeFormat(pattern="yyyy-MM-dd") //时间格式化
private Date birth;
`@NumberFormat(pattern="#,###,###.#")//数字格式化格式
private Float salary;`
这样简单的注解就可以搞定从前台传过来的数据
SpringMVC.xml里添加:
<mvc:annotation-driven ></mvc:annotation-driven>
@DateTimeFormat(pattern="yyyy-MM-dd") //时间格式化
private Date birth;
`@NumberFormat(pattern="#,###,###.#")//数字格式化格式
private Float salary;`
这样简单的注解就可以搞定从前台传过来的数据