问题描述
- spring boot 版本 2.6.4
在整合thymeleaf. security时,代码报错:“Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/thymeleaf/web/servlet/JavaxServletWebApplication] with root cause”
经过自己的测试,发现是整合包依赖导入导致的,去掉这个依赖项目运行正常
这里thymeleaf版本都是3.0.15,项目使用的spring版本是5.3.16,因此导入thymeleaf-spring5应该是没错的。
html中命名空间也是spring5的命名空间
函数提示也是ok的,不知道哪个版本出了什么问题。