springBoot spring6 无法加载 thymeleaf的,在html页面中无法智能感知 th:这些

发布时间 2023-09-12 12:54:30作者: 华安

网上所有的坑我都试过了,还是无法解决问题,

@Controller
public class SellController {
    @RequestMapping("/test01")
  /*  @ResponseBody  */
    public String index(){
        return "test01";
    }
}

”test01“ 下面永远是波浪线,无论把网上查出来的解决问题的方案我都试了一遍,永远是 404,加载不了 "test01" 模板引擎,

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>Thymeleaf视图引擎</h1>
</body>
</html>

这个页面中也无法智能感应 th: 这些 Thymeleaf 语法。

总结:就是 Thymeleaf模板引擎没加载正确。

最后没办法,就把    c盘下    用户.m2\repository\org\springframework  下面的文件全部删除了,重新下载,然后再运行就正常了。

坑爹啊,这玩意,太不智能了。。。。。。。。。。。。。。