Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <beans>
- <context:annotation-config/>
- <bean class="com.foo.AppConfig"/>
- </beans>
- Where 'AppConfig' is a @Configuration class:
- @Configuration
- public class AppConfig {
- public @Bean Foo foo() {
- return new Foo();
- }
- }
- The application would then be bootstrapped as follows:
- ApplicationContext context = new ClassPathApplicationContext("app-config.xml");
- Foo foo = context.getBean("foo", Foo.class);
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement