Will < context:component-scan base-package= "" / > scan the @ RequestMapping annotation?

,,Spring mvc:
    <context:component-scan base-package="..."/>
@Controller,@RequestMapping. 

,<context:component-scan base-package=""/>Spring,
Spring mvc,?   

spring mvc has a default DefaultAnnotationHandlerMapping to handle RequestMapping

spring and spring mvc are two different containers, and spring is the parent container and, spring mvc is the child container. In that case, the child container is the bean, that can access the parent container, and the parent container cannot access the bean of the child container.

  1. configure global scanning in spring: the spring container contains all bean,spring mvc without bean, so load the processor, mapper, and you will not find the mapping object, mapping relationship, page 404
  2. configuring the global scan: spring mvc container in spring mvc contains all the bean, equivalent to the spring container has no function, and the bena in it is a normal bean,. What about your transaction and such spring-related operations?

so the two framework profiles are configured on demand.

Menu