spring-framework/org.springframework.web.ser...
Chris Beams 025b8abfaf Allow ACI classes access to servlet context params
Prior to this commit, StandardServletEnvironment's servlet context
PropertySource remained stubbed out until it the ServletContext became
available and could be replaced during the refresh() of its enclosing
WebApplicationContext. This behavior is acceptable in most cases.
However, if the user has declared an ApplicationContextInitializer that
attempts to access servlet context-params via the Environment API, this
result in a kind of 'false negative', i.e. the context-param key and
value are actually present in the ServletContext, but the PropertySource
representing servlet context params is still a stub at this point,
meaning that it returns an empty result in all cases.

With this change, WebApplicationContextUtils#initServletPropertySources
is invoked eagerly by the ContextLoader if any ACI classes have been
declared. This swaps out the servlet context property source stub for
the real thing just in time for ACIs to use it if necessary.

Extra guard logic has been added to #initServletPropertySources to
ensure idempotency -- once the stub has been replaced, the method
never attempts the replacement again, e.g. during the normal context
refresh() when this method will be called again.

Issue: SPR-8991
2012-02-04 23:13:52 +01:00
..
.settings ModelAndViewContainer related refinements 2011-04-07 18:09:28 +00:00
src Allow ACI classes access to servlet context params 2012-02-04 23:13:52 +01:00
.classpath [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
.project adding eclipse project settings 2008-10-27 15:48:40 +00:00
build.xml + upgrade to AspectJ 1.6.8 2010-02-04 11:46:21 +00:00
ivy.xml used specific SLF4J versions for running the test suites of individual modules (fixing the Hibernate Validator 4.2 upgrade) 2011-12-09 17:53:29 +00:00
pom.xml Add <license> section to 3.1.x Maven poms 2012-01-31 15:18:05 +01:00
template.mf mvc:annotation-driven reliably detects JSR-303 and JAXB2 in an OSGi environment as well (SPR-7291) 2010-06-20 18:55:21 +00:00
web-servlet.iml Convert CRLF=>LF on files missed earlier 2011-12-22 14:06:44 +01:00