Spring security Thymeleaf:Spring安全性:处理器执行期间出错';授权处理器';

Spring security Thymeleaf:Spring安全性:处理器执行期间出错';授权处理器';,spring-security,thymeleaf,Spring Security,Thymeleaf,当我进入使用sec:authorize的thymeleaf页面时,会出现此错误 请求处理失败;嵌套异常为org.thymeleaf.exceptions.TemplateProcessingException:执行处理器“org.thymeleaf.extras.springsecurity4.dial.processor.AuthorizeAttrProcessor”时出错 根本原因 java.lang.IllegalStateException:未找到WebApplicationConte

当我进入使用sec:authorize的thymeleaf页面时,会出现此错误

请求处理失败;嵌套异常为org.thymeleaf.exceptions.TemplateProcessingException:执行处理器“org.thymeleaf.extras.springsecurity4.dial.processor.AuthorizeAttrProcessor”时出错

根本原因

java.lang.IllegalStateException:未找到WebApplicationContext:未注册ContextLoaderListener

相关依赖项为:


4.2.4.1发布
2.1.4.1发布
org.springframework.security
spring安全网
4.1.3.1发布
org.thymeleaf.extras
thymeleaf-extras-springsecurity4
2.1.2.1发布
org.thymeleaf
百里香
${thymeleaf.version}
org.thymeleaf
百里香
${thymeleaf.version}
org.thymeleaf.extras
百里香-附加-瓷砖2-spring4
2.1.1.1发布

答案是,您需要在web.xml中指定上下文加载程序侦听器。这与teleaf无关。它只是spring配置


上下文配置位置
/WEB-INF/config/*\u applicationContext.xml

答案是,您需要在web.xml中指定上下文加载程序侦听器。这与teleaf无关。它只是spring配置


上下文配置位置
/WEB-INF/config/*\u applicationContext.xml