被 @Bean 註解標註的方法會創建一個 bean 的實例,放在 spring IoC 容器中。等需要使用這個 bean 的時候,在類裏用 @Autowired,@Resource 注入這個對象就行了。
例如:
@Bean
public AccountDao accountDao() {
return new AccountDao();
}
被 @Bean 註解標註的方法會創建一個 bean 的實例,放在 spring IoC 容器中。等需要使用這個 bean 的時候,在類裏用 @Autowired,@Resource 注入這個對象就行了。
例如:
@Bean
public AccountDao accountDao() {
return new AccountDao();
}
Java word通過html設置樣式(Spire Docx) <dependencies> <!-- Apache POI dependency for Word --> <dependency>