Updated documentation to point out that AnnotationConfigWebApplicationContext can accept both fully-qualified class names as well as base packages to the contextConfigLocation init-param.
This commit is contained in:
parent
d13f0c8052
commit
1cda8cb6fa
|
|
@ -43,7 +43,8 @@ import org.springframework.context.annotation.ScopeMetadataResolver;
|
|||
* <p>Unlike {@link XmlWebApplicationContext}, no default configuration class locations
|
||||
* are assumed. Rather, it is a requirement to set the "contextConfigLocation"
|
||||
* context-param for ContextLoader and/or "contextConfigLocation" init-param for
|
||||
* FrameworkServlet.
|
||||
* FrameworkServlet. The param-value may contain both fully-qualified
|
||||
* class names and base packages to scan for components.
|
||||
*
|
||||
* <p>Note: In case of multiple {@literal @Configuration} classes, later {@literal @Bean}
|
||||
* definitions will override ones defined in earlier loaded files. This can be leveraged
|
||||
|
|
|
|||
|
|
@ -5832,7 +5832,8 @@ The above assumes that <literal>MyServiceImpl</literal>, <literal>Dependency1</l
|
|||
</context-param>
|
||||
|
||||
<!-- Configuration locations must consist of one or more comma- or space-delimited
|
||||
fully-qualified @Configuration classes -->
|
||||
fully-qualified @Configuration classes. Fully-qualified packages may also be
|
||||
specified for component-scanning -->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>com.acme.AppConfig</param-value>
|
||||
|
|
@ -5847,7 +5848,7 @@ The above assumes that <literal>MyServiceImpl</literal>, <literal>Dependency1</l
|
|||
<servlet>
|
||||
<servlet-name>dispatcher</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<!-- Configure DispatcherServlet to use JavaConfigWebApplicationContext
|
||||
<!-- Configure DispatcherServlet to use AnnotationConfigWebApplicationContext
|
||||
instead of the default XmlWebApplicationContext -->
|
||||
<init-param>
|
||||
<param-name>contextClass</param-name>
|
||||
|
|
|
|||
Loading…
Reference in New Issue