Here is the line
th:attr="${row.link!=null} ? onclick=|rowClicked('${row.link.url()}', '${T(java.util.Arrays).toString(row.link.params())}','${row.componentId}')|" >
这是错误。我检查row.link是否为null,但仍将尝试计算该表达式。当row.link不为null时,它将正确设置onclick属性。我还尝试在末尾附加:
和: myattr=2
只是为了查看它是否需要某些东西,这些东西不是事件可解析的。
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "row.link.url()" (template: "fragments/table.html" - line 108, col 11)
...
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method url() on null context object