Consider defining a bean named ‘shiroFilterFactoryBean’ in your configuratio。
No bean named ‘shiroFilterFactoryBean’ available
ShiroWebFilterConfiguration required a bean named ‘shiroFilterFactoryBean’ t。

代码未报错,但是出现运行时出现问题,查阅文献后发现:问题在没有shiroFilterFactoryBean
解决方法是在@Bean后加上

(name = "shiroFilterFactoryBean")

@Bean(name = "shiroFilterFactoryBean")
    public ShiroFilterFactoryBean getShiroFilterFactoryBean(@Qualifier("getDefaultWebSecurityManager") DefaultWebSecurityManager defaultWebSecurityManager){
        ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
        //设置安全管理器
        bean.setSecurityManager(defaultWebSecurityManager);
        return bean;
    }

标签: none

添加新评论