<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ja">
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<p th:text="${user}"></p>
<!-- [[${user.name}]] -->
</body>
</html>
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "user.name" (template: "/view/success" - line 11, col 5)
11行已经注释掉但还是报错,
修改入下:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ja">
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<p th:text="${user}"></p>
<!-- [[${user.username}]] -->
</body>
</html>
改完之后他就好了,mmd ,
总结: thymeleaf 会将注释掉的代码也加载