• 2022-07-22
    基于Annotation的装配,把service层中的javaBean注入到spring中,用什么注解?
    A: @Service
    B: @Repository
    C: @Autowired
    D: @Resource
  • A
    本题目来自[网课答案]本页地址:https://www.wkda.cn/ask/eeozoozypepomtto.html

    内容

    • 0

      可以实现自动注入的注解是? A: ModelAttribute B: Service C: Controller D: Autowired

    • 1

      用于指定Spring Boot扫描组件目标的注解是 A: @Configuration B: @Autowired C: @ComponentScan D: @Service

    • 2

      基于注解(Annotation)的装配中,对类成员变量、方法及构造方法进行标注,完成自动装配的工作。通过使用( )来消除setter和getter方法。 A: @Autowired B: @Resource C: @Qualifie D: @AsPectJ

    • 3

      Spring中定义了一系列的注解,以下有关其常用的注解说明错误的是。() A: @Autowired用于对Bean的属性变量、属性的setter方法及构造方法进行标注,配合对应 B: @Repository用于将数据访问层(DAO层)的类标识为Spring中的Bean C: @Service通常作用在业务层(Service层),用于将业务层的类标识为Spring中的Bean D: @Controller通常作用在控制层(如Spring MVC的Controller),用于将控制层的类标识为Spring中的Bean

    • 4

      下面哪个注解符号可以对Dao层的类进行注解 A: @Controller B: @Service C: @Repository D: @Qualifier