Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reproduce SPR-8991

  • Loading branch information...
commit c978b5790fee3a109bd8bf7a7ceec02ade77f935 1 parent 9576d78
@cbeams cbeams authored
View
1  SPR-8991/pom.xml
@@ -92,7 +92,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8</version>
- <scope>test</scope>
</dependency>
</dependencies>
View
33 SPR-8991/src/main/java/spr8991/Spr8991ACI.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2002-2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package spr8991;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.springframework.context.ApplicationContextInitializer;
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class Spr8991ACI implements ApplicationContextInitializer<ConfigurableApplicationContext> {
+
+ @Override
+ public void initialize(ConfigurableApplicationContext applicationContext) {
+ String answer = applicationContext.getEnvironment().getRequiredProperty("answer");
+ assertThat(answer, is("42"));
+ }
+
+}
View
10 SPR-8991/src/main/webapp/WEB-INF/web.xml
@@ -13,6 +13,16 @@
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
+ <context-param>
+ <param-name>contextInitializerClasses</param-name>
+ <param-value>spr8991.Spr8991ACI</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>answer</param-name>
+ <param-value>42</param-value>
+ </context-param>
+
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
Please sign in to comment.
Something went wrong with that request. Please try again.