1
我们都知道一个日期验证的典型例子在initBinder
方法内部控制器:在的Spring Java 8时API日期验证
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
但是,什么是支持新的Java 8时间替代API,我们需要将DateFormat
更换为DateTimeFormatter
? Spring Framework提供了哪些工具?
谢谢。