Freemarker中时间的问题

FreeMarker template error (DEBUG mode; use RETHROW in production!): Can't convert the date-like value to string because it isn't known if it's a date (no time part), time or date-time value. The blamed expression: ==> pageInfo.updateTime [in template "News/list.ftl" at line 36, column 35] ---- Tip: Use ?date, ?time, or ?datetime to tell FreeMarker the exact type. ---- Tip: If you need a particular format only once, use ?string(pattern), like ?string('dd.MM.yyyy HH:mm:ss'), to specify which fields to display. ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${pageInfo.updateTime} [in template "News/list.ftl" at line 36, column 33] ---- Java stack trace (for programmers): 

如上图箭头,需要把数据库传入的Date类型转换为String

修改为

猜你喜欢

转载自blog.csdn.net/sinat_32856935/article/details/82627118