美文网首页
SpringBoot集成shiro,在ShiroConfig里面

SpringBoot集成shiro,在ShiroConfig里面

作者: dbc94a66f502 | 来源:发表于2019-05-22 10:58 被阅读0次

问题:
SpringBoot集成shiro,在ShiroConfig里面通过@Value读取不了配置的值

@Configuration
public class ShiroConfig {
    @Value("${oauth2.client_id}")
    public String clientId;
    @Value("${oauth2.client_secret}")
    public String clientSecret;
    @Value("${oauth2.access_token_url}")
    public String accessTokenUrl;
    @Value("${oauth2.userinfo_url}")
    public String userInfoUrl;
    @Value("${oauth2.redirect_url}")
    public String redirectUrl;

解决方法:将生命周期处理器LifecycleBeanPostProcessor 设为静态,原因不详,请网友赐教。

  @Bean
    public static LifecycleBeanPostProcessor getLifecycleBeanPostProcessor() {
        return new LifecycleBeanPostProcessor();
    }

相关文章

网友评论

      本文标题:SpringBoot集成shiro,在ShiroConfig里面

      本文链接:https://www.haomeiwen.com/subject/dzdyzqtx.html