spring ioc的註解 學習總結

spring ioc的註解 @Component註解 適用於工具類等非三層【dao層,service層,web層】對象的創建。 即:把對象放在spring的ioc容器中 用法如下: /* @Component註解 相當於 bean標籤中的class="全限定類名",其默認id是當前類 類名首字母小寫,也可以通過@Component註解的value屬性去指定id。 比如:@Component("us
相關文章
相關標籤/搜索