https://stackoverflow.com/questions/42386957/how-to-refer-to-another-bean-as-a-property-in-annotation-based-configuration-fil
@Configuration class GlobalConfiguration { @Bean @Autowired public Example createExample(AnotherBean anotherBean){ final Example example = new Example(); example.setSomeProp(anotherBean); return example; } @Bean public AnotherBean createAnotherBean(){ return new AnotherBean(); } }
No comments:
Post a Comment