问题描述
event.eventStart
是OffsetDateTime对象。
已添加到POM
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
<version>3.0.4.RELEASE</version>
</dependency>
将Java8TimeDialect添加到TemplateEngine
final SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.addDialect(new Java8TimeDialect());
预期-此行在我的电子邮件中显示格式化时间。
<span th:text="${#temporals.format( ${event.eventStart},'yyyy-MM-dd HH:mm:ss ZZZZ')}"></span>
实际-
Expression [#temporals.format( ${event.eventStart},'yyyy-MM-dd HH:mm:ss ZZZZ')] @20: EL1043E: Unexpected token. Expected 'rparen())' but was 'lcurly({)'
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)