1.Component
有三种写法:
@Component(value = "myStudent")//使用value属性指定对象的名称
@Component//不指定对象名称,由spring提供默认名称:类名的首字母小写
@Component("myStudent")//省略value
在配置文件中:
<context:component-scan base-package="com.dwk.ba01"/>
还有另外三个和@Component功能、用法一致的注解
1.Component
有三种写法:
@Component(value = "myStudent")//使用value属性指定对象的名称
@Component//不指定对象名称,由spring提供默认名称:类名的首字母小写
@Component("myStudent")//省略value
在配置文件中:
<context:component-scan base-package="com.dwk.ba01"/>
还有另外三个和@Component功能、用法一致的注解