spring ioc的注解 学习总结

spring ioc的注解 @Component注解 适用于工具类等非三层【dao层,service层,web层】对象的创建。 即:把对象放在spring的ioc容器中 用法如下: /* @Component注解 相当于 bean标签中的class="全限定类名",其默认id是当前类 类名首字母小写,也可以通过@Component注解的value属性去指定id。 比如:@Component("us
相关文章
相关标签/搜索