springbaat+shira+thymeleof 整合坑
发现了一个万米深坑
springbaat+shira+thymeleof 整合的时候
操作都正常的时候,shiro标签都正常,非常完美。
但是,我草但可是,,
当404 500 401 403 的时候 shiro标签失效。
会报错,错误栈列表:
org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/error/404.html]")
Error during execution of processor 'at.pollux.thymeleaf.shiro.processor.element.PrincipalElementProcessor' (template: "error/404" - line 19, col 24)
No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.
org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/error/404.html]")
Error during execution of processor 'at.pollux.thymeleaf.shiro.processor.element.PrincipalElementProcessor' (template: "error/404" - line 19, col 24)
南来的,北往的,有遇到过的吗?
没落了
根据你提供的错误信息来看,似乎是在处理404、500、401和403等错误页面时,Shiro标签失效了,导致Thymeleaf模板引擎无法正常解析模板。错误信息中提到了No SecurityManager accessible to the calling code,这可能是因为在错误页面中没有正确地配置Shiro的安全管理器。建议检查一下错误页面的配置,确保Shiro安全管理器已正确配置并可访问。另外,也可以尝试在错误页面中手动绑定安全管理器到ThreadContext中。
https://cool-js.com/