Multi Scan

I used Spring ROO to create an MVC project. I see the first scan component in webmvc-config.xml loaded through org.springframework.web.servlet.DispatcherServlet in the web.xml file:

<context:component-scan base-package="com.nexlabs.countryapp" use-default-filters="false">
    <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
</context:component-scan>
<mvc:resources location="/, classpath:/META-INF/resources/" mapping="/resources/**"/>

Now in another component scan in the classpath: / META-INF / resources / spring / applicationContext.xml:

<context:component-scan base-package="com.nexlabs.countryapp.*">
    <context:exclude-filter expression=".*_Roo_.*" type="regex"/>
    <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
</context:component-scan>

Question 1: Why are there two scan components in two different places? Question 2. What is the size of the "context" tag? Is the parameter in the context tag used only for a specific XML file?

+1
source share

Source: https://habr.com/ru/post/1607521/


All Articles