@Configuration
@EnableConfigurationProperties(RedisProperties.class)
public class AutoConfig {
@Autowired
RedisProperties redisProperties;
public AutoConfi(){
System.out.println("AutoConfig initialization.....");
}
@Bean
public TestFilter getTestFilter() {
return new TestFilter();
}
}
如下用@Configuration为TestFilter创建Bean.@Configuration@EnableConfigurationProperties(RedisProperties.class) public class AutoConfig { @Autowired RedisProperties redisProperties; public