标注一个类为 Spring 容器的 Bean
类似的注解还有:
@Controller
:控制器层
@Service
:服务层
@Repository
:持久层
@Configuration
:配置
public @interface Component {
// 自定义 bean 名称,默认是小写的类名
String value() default "";
}
搜索
标注一个类为 Spring 容器的 Bean
类似的注解还有:
@Controller
:控制器层
@Service
:服务层
@Repository
:持久层
@Configuration
:配置
public @interface Component {
// 自定义 bean 名称,默认是小写的类名
String value() default "";
}