Updated documentation to point out that AnnotationConfigWebApplicationContext can accept both fully-qualified class names as well as base packages to the contextConfigLocation init-param.

master
Chris Beams 15 years ago
parent d13f0c8052
commit 1cda8cb6fa
  1. 3
      org.springframework.web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java
  2. 5
      spring-framework-reference/src/beans.xml

@ -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…
Cancel
Save