Skip to content

Commit 722cd17

Browse files
committed
Clean up property values registration in SimpleWebApplicationContext
Closes gh-22787
1 parent b07d46d commit 722cd17

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,10 +47,6 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext {
4747

4848
@Override
4949
public void refresh() throws BeansException {
50-
MutablePropertyValues pvs = new MutablePropertyValues();
51-
pvs.add("commandClass", "org.springframework.tests.sample.beans.TestBean");
52-
pvs.add("formView", "form");
53-
5450
registerSingleton("/locale.do", LocaleChecker.class);
5551

5652
addMessage("test", Locale.ENGLISH, "test message");
@@ -63,7 +59,7 @@ public void refresh() throws BeansException {
6359
registerSingleton("handlerMapping", BeanNameUrlHandlerMapping.class);
6460
registerSingleton("viewResolver", InternalResourceViewResolver.class);
6561

66-
pvs = new MutablePropertyValues();
62+
MutablePropertyValues pvs = new MutablePropertyValues();
6763
pvs.add("location", "org/springframework/web/context/WEB-INF/sessionContext.xml");
6864
registerSingleton("viewResolver2", XmlViewResolver.class, pvs);
6965

@@ -76,6 +72,7 @@ public static class LocaleChecker implements Controller, LastModified {
7672
@Override
7773
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
7874
throws ServletException, IOException {
75+
7976
if (!(RequestContextUtils.findWebApplicationContext(request) instanceof SimpleWebApplicationContext)) {
8077
throw new ServletException("Incorrect WebApplicationContext");
8178
}

0 commit comments

Comments
 (0)