Undefined attribute name (th:text).

在eclipse中用到thymeleaf时会提示“Undefined attribute name (th:text).”

解决办法
1、在html标签中写

<html xmlnsth="http://www.thymeleaf.org">

2、把要取值的标签写在block标签里

<th:block xmlns:th="http://www.thymeleaf.org">
    <div th:text="${'Here we go Thymeleaf!'}"></div>
</th:block>

猜你喜欢

转载自blog.csdn.net/z_huing/article/details/80012363