Skip to content

Instantly share code, notes, and snippets.

@keesun
Created January 18, 2012 14:09
Show Gist options
  • Select an option

  • Save keesun/1633158 to your computer and use it in GitHub Desktop.

Select an option

Save keesun/1633158 to your computer and use it in GitHub Desktop.
Spring 3.1's @import & @enable
@Configuration
@EnableHello
public class AppConfig {
}
@Retention(value = RetentionPolicy.RUNTIME)
@Import(HelloConfig.class)
public @interface EnableHello {
String name();
}
@Configuration
public class HelloConfig {
@Bean
public Hello hello() {
Hello h = new Hello();
h.setName("Toby");
return h;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment