【发布时间】:2020-11-19 10:28:10
【问题描述】:
我正在开发一个 Spring Boot 和 Hibernate 项目
我的一个实体类有一个 localDate 和 localTime 用于不同的目的
public class User{
private LocalTime dailyStartTime;
private LocalDate UniversityStartDate;
//There are other fields here as well
}
我的jsp表单是这样的
<frm:form modelAttribute="user">
<frm: input type="time" path="dailyStartTime">
<frm: input type="date" path="UniversityStartDate">
</frm:form
使用@InitBinder,我可以解析日期并在用户对象中更新日期。
但我无法将出现错误的时间解析为 typeMismatch(无法将 String 的属性值转换为 LocalTime)
【问题讨论】:
标签: java spring spring-boot hibernate