解决org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling

再有有@Configuration 此注解的类中加入:

@Bean
     public FilterRegistrationBean delegatingFilterProxy(){
         FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
         DelegatingFilterProxy proxy = new DelegatingFilterProxy();
         proxy.setTargetFilterLifecycle(true);
         proxy.setTargetBeanName("shiroFilter");
         filterRegistrationBean.setFilter(proxy);
         return filterRegistrationBean;
     }

你可能感兴趣的:(java开发)