Springboot+Thymeleaf中,SpringEL的使用

在Html页面中,使用el表达式,绑定后台值没有问题,但怎么使用后台的方法对值进行处理呢?

<th:block th:each="post : ${users.list}">
   <tr th:cid="${post.uid}">
      <td><th:block th:text="${post.created}"/></td>
      <td><th:block th:text="${com.gateway.website.utils.Commons.fmtdate(post.created)}"/></td>
   </tr>
</th:block>

fmtdate方法是个时间戳转换为日期的方法。
单独写第一个td是是有值的,写第二个会报错,Exception evaluating SpringEL expression
不清楚怎么用,还是说fmtdate方法这边要做什么工作,往指导...谢谢

阅读 5.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题