自定义时间转换器converter

作用:由于springMvc无法将string自动转换成date所以需要自己手动编写类型转换器(页面传过来的String类型springMvc不能自动转换为date类型,所以需要手动转换)。

需要编写一个类实现Converter接口

在springMvc.xml中配置自定义转换器

在springMvc.xml中将自定义转换器配置到注解驱动上

 

posted @ 2019-07-09 17:14  txf-0324  阅读(342)  评论(0编辑  收藏  举报