问题:
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();
}