I have a class with the property
var isDone: Boolean
but if I reference it in a Thymeleaf template
<span th:text="${task.isDone}></span>
I get the following error
org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field ‘isDone’ cannot be found on object of type …
I’m wondering why it doesn’t work, since the Java Bean standard allows boolean methods starting with is
. The compiler generates the following method:
public final boolean isDone() {
return this.isDone;
}
Looking at this method I would expect it to work, but Spring EL seems to expect isIsDone
.
It works if I use only done
in the tempalte:
<span th:text="${task.done}></span>
… or if I name the property isIsDone
and use isDone
in the template.
Why does isDone
doesn’t work although it meets the bean convention?
Is there a simple solution (like the Kotlin extensions for Jackson)?