1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -47,10 +47,6 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext {
47
47
48
48
@ Override
49
49
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
-
54
50
registerSingleton ("/locale.do" , LocaleChecker .class );
55
51
56
52
addMessage ("test" , Locale .ENGLISH , "test message" );
@@ -63,7 +59,7 @@ public void refresh() throws BeansException {
63
59
registerSingleton ("handlerMapping" , BeanNameUrlHandlerMapping .class );
64
60
registerSingleton ("viewResolver" , InternalResourceViewResolver .class );
65
61
66
- pvs = new MutablePropertyValues ();
62
+ MutablePropertyValues pvs = new MutablePropertyValues ();
67
63
pvs .add ("location" , "org/springframework/web/context/WEB-INF/sessionContext.xml" );
68
64
registerSingleton ("viewResolver2" , XmlViewResolver .class , pvs );
69
65
@@ -76,6 +72,7 @@ public static class LocaleChecker implements Controller, LastModified {
76
72
@ Override
77
73
public ModelAndView handleRequest (HttpServletRequest request , HttpServletResponse response )
78
74
throws ServletException , IOException {
75
+
79
76
if (!(RequestContextUtils .findWebApplicationContext (request ) instanceof SimpleWebApplicationContext )) {
80
77
throw new ServletException ("Incorrect WebApplicationContext" );
81
78
}
0 commit comments