0
我正在用Thymeleaf做我的第一個項目。我的大部分工作都完成了......除了下面這部分。在Thymeleaf中使用Dynamic key for hashMap,以及屬性
<img th:attrappend="src='file:///' + ${entryImageMap['__${entry.id}__']}"></img>
這是我從Thymeleaf
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating OGNL expression: "entryImageMap['83383894']" (template: "Report.html" - line 89, col 6)
我已經試過微小變化得到的錯誤。這是我通過各種錯誤的方式取得的進展,仍然不清楚。
<img th:attrappend="src=file:///${entryImageMap.(entry.id)}"></img>
<img th:attrappend="src=file:///${entryImageMap[__${entry.id}__]}"></img>
<img th:attrappend="src='file:///' + ${entryImageMap[__${entry.id}__]}"></img>
<img th:attrappend="src='file:///' + ${entryImageMap['__${entry.id}__']}"></img>