From 1cda8cb6fa82d4f965d653d811a42dd245cb2fa7 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 28 Jan 2010 03:42:42 +0000 Subject: [PATCH] Updated documentation to point out that AnnotationConfigWebApplicationContext can accept both fully-qualified class names as well as base packages to the contextConfigLocation init-param. --- .../support/AnnotationConfigWebApplicationContext.java | 3 ++- spring-framework-reference/src/beans.xml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/org.springframework.web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java b/org.springframework.web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java index efa1afdd6f..e47c26fa9d 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java +++ b/org.springframework.web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java @@ -43,7 +43,8 @@ import org.springframework.context.annotation.ScopeMetadataResolver; *

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. * *

Note: In case of multiple {@literal @Configuration} classes, later {@literal @Bean} * definitions will override ones defined in earlier loaded files. This can be leveraged diff --git a/spring-framework-reference/src/beans.xml b/spring-framework-reference/src/beans.xml index f6a11e82d7..4490325b1f 100644 --- a/spring-framework-reference/src/beans.xml +++ b/spring-framework-reference/src/beans.xml @@ -5832,7 +5832,8 @@ The above assumes that MyServiceImpl, Dependency1 + fully-qualified @Configuration classes. Fully-qualified packages may also be + specified for component-scanning --> contextConfigLocation com.acme.AppConfig @@ -5847,7 +5848,7 @@ The above assumes that MyServiceImpl, Dependency1 dispatcher org.springframework.web.servlet.DispatcherServlet - contextClass