基于注解(Annotation)的装配中,用于标注一个业务逻辑注解类(Service层)的Bean是( )。
A: @Component
B: @Repository
C: @Service
D: @Controlle
A: @Component
B: @Repository
C: @Service
D: @Controlle
C
本题目来自[网课答案]本页地址:https://www.wkda.cn/ask/eeozoozaojptpyxo.html
举一反三
- 基于注解(Annotation)的装配,用于将数据访问层(DAO)的类标识为Bean的是( )。 A: @Component B: @Repository C: @Controlle D: @Service
- SpringMVC中标注一个类为控制器,最好使用哪个注解 A: Controlle B: Repository C: Service D: Component
- @Bean注解的方法所在的类应该使用哪个注解 A: @Component B: @Configuration C: @Service D: @Repository
- 基于Annotation的装配,把service层中的javaBean注入到spring中,用什么注解? A: @Service B: @Repository C: @Autowired D: @Resource
- @ComponentScan:启用组件扫描的注解,它会主动扫码哪些注解声明的类? A: @Component B: @Controlle C: @Service D: @RequestMapping E: @Repository
内容
- 0
下面哪个注解符号可以对Dao层的类进行注解 A: @Controller B: @Service C: @Repository D: @Qualifier
- 1
Spring中定义了一系列的注解,以下有关其常用的注解说明错误的是。() A: @Autowired用于对Bean的属性变量、属性的setter方法及构造方法进行标注,配合对应 B: @Repository用于将数据访问层(DAO层)的类标识为Spring中的Bean C: @Service通常作用在业务层(Service层),用于将业务层的类标识为Spring中的Bean D: @Controller通常作用在控制层(如Spring MVC的Controller),用于将控制层的类标识为Spring中的Bean
- 2
Spring注解中用于指定当前类是一个配置类的注解是? A: @Component B: @Configuration C: @Bean D: @Import
- 3
Spring中定义了一系列的注解,常用的注解有() A: @Autowired B: @Repository C: @Service D: @Controller
- 4
Spring注解中使用在类上用于实例化Bean的注解是? A: @ Component B: @Value C: @Test D: @Bean