tianphone

使用templates模板,已经在controller中,将变量的赋值了,但是html页面中,还是显示红色警告,cannot
resolve xxx...。在运行时不会报错,如果看着不舒服,可以加上注解就可以了,使用Alt+回车,就能自动生成注解

 模板文件:

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<meta>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--/*@thymesVar id="message" type="java.lang.String"*/-->
    <h1 th:text="${message}">Hello World</h1>
</body>
</html>
View Code

 

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2021-10-12
  • 2021-10-01
  • 2021-12-12
  • 2021-06-13
  • 2021-09-27
  • 2022-01-18
  • 2021-05-25
猜你喜欢
  • 2021-09-16
  • 2021-08-13
  • 2021-04-11
  • 2021-07-29
  • 2021-05-06
  • 2021-08-01
相关资源
相似解决方案