首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    解决:Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;

    关注微信公众号“假装正经的程序员”,回复“日期转换”即可获取解决方案 发生这一错误的主要原因是Controller类中需要接收的是Date类型,但是在页面端传过来的是String类型,最终导致了这个错误...public class UserController{ @RequestMapping(value="/login.do") public String login(String username,Date...DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); binder.registerCustomEditor(Date.class...WebBindingInitializer import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date...DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); binder.registerCustomEditor(Date.class

    6.7K20
    领券