我有這樣一個控制器:
it.render(
"my-list.html"。
mapOf(
"votes-positive" to repo.votesOf("x") 。
)
)
//...。
data class Vote(
val name: String,
val type: 型別。
) {
enum class Type { POS, NEG }
}
我的模板檔案"my-list.html:
<! DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"/span>>
<body>
<div th:each=" vote : ${votes-positive}">
<span th:text="${vote.name}"> </span>
</div>
</body>
我在運行時得到了這個錯誤,這讓我很抓狂:
我在運行時得到了這個錯誤。
[qtp119358627-23] ERROR org.thymeleaf. TemplateEngine - [THYMELEAF][qtp119358627-23] 處理模板"my-list.html"的例外:評估OGNL運算式例外。"vote.name"(模板。"my-list.html" - line 21, col 15)
org.thymeleaf.exceptions.TemplateProcessingException。評估OGNL運算式時出現例外。"vote.name"(模板。"my-list.html" - line 21, col 15)
是否有一個Thymleaf除錯模式?有辦法列印模型樹嗎?我不知道為什么運算式是錯誤的。
uj5u.com熱心網友回復:
嘗試將votes-positive改為不使用連字符的內容。這將被解釋為OGNL減法運算式中的一個減號。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/311873.html
標籤:
上一篇:谷歌分析4測量協議不作業
