如何将弦转换为日期在百里香中?
我有以下输入:
<input name="dateOfOrder" class="form-control" id="dateOfOrder" type="date" th:field="*{{dateOfOrder}}" />
哦,这是将其插入的DTO的片段:
@DateTimeFormat(pattern="yyyy-MM-dd")
private LocalDate dateOfOrder;
不幸的是,我有一个例外:
无法从类型[java.lang.string]转换为类型 [java.time.localdate]从价值'2022-06-14';嵌套异常是 java.lang.illegalargumentException:解析尝试失败 [2022-06-14]。
我不熟练掌握百里香,想暗示这里有什么问题
I have the following input:
<input name="dateOfOrder" class="form-control" id="dateOfOrder" type="date" th:field="*{{dateOfOrder}}" />
And oh this is the fragment of the DTO into which they are inserted :
@DateTimeFormat(pattern="yyyy-MM-dd")
private LocalDate dateOfOrder;
Unfortunately I get an exception:
Failed to convert from type [java.lang.String] to type
[java.time.LocalDate] from value '2022-06-14'; nested exception is
java.lang.IllegalArgumentException: Parse attempt failed from value
[2022-06-14].
I`m not proficient in Thymeleaf and would like some hints on what is wrong here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用胸腺格式。
You need to use Thymeleaf formatting.