Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 7b8508d

Browse files
committed
Project for issue SPR-9818
1 parent f32f69a commit 7b8508d

File tree

11 files changed

+377
-0
lines changed

11 files changed

+377
-0
lines changed

SPR-9818/pom.xml

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org.springframework.issues</groupId>
5+
<artifactId>SPR-9818</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>Spring MVC Issue Reproduction Project</name>
8+
<packaging>war</packaging>
9+
10+
<properties>
11+
<java-version>1.6</java-version>
12+
<org.springframework-version>3.2.0.BUILD-SNAPSHOT</org.springframework-version>
13+
<org.slf4j-version>1.6.1</org.slf4j-version>
14+
</properties>
15+
16+
<dependencies>
17+
<!-- Spring Framework -->
18+
<dependency>
19+
<groupId>org.springframework</groupId>
20+
<artifactId>spring-context</artifactId>
21+
<version>${org.springframework-version}</version>
22+
<exclusions>
23+
<!-- Exclude Commons Logging in favor of SLF4j -->
24+
<exclusion>
25+
<groupId>commons-logging</groupId>
26+
<artifactId>commons-logging</artifactId>
27+
</exclusion>
28+
</exclusions>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.springframework</groupId>
32+
<artifactId>spring-webmvc</artifactId>
33+
<version>${org.springframework-version}</version>
34+
</dependency>
35+
36+
<!-- CGLIB, required for @Configuration usage -->
37+
<dependency>
38+
<groupId>cglib</groupId>
39+
<artifactId>cglib-nodep</artifactId>
40+
<version>2.2</version>
41+
</dependency>
42+
43+
<!-- Logging -->
44+
<dependency>
45+
<groupId>org.slf4j</groupId>
46+
<artifactId>slf4j-api</artifactId>
47+
<version>${org.slf4j-version}</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.slf4j</groupId>
51+
<artifactId>jcl-over-slf4j</artifactId>
52+
<version>${org.slf4j-version}</version>
53+
<scope>runtime</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.slf4j</groupId>
57+
<artifactId>slf4j-log4j12</artifactId>
58+
<version>${org.slf4j-version}</version>
59+
<scope>runtime</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>log4j</groupId>
63+
<artifactId>log4j</artifactId>
64+
<version>1.2.16</version>
65+
<scope>runtime</scope>
66+
</dependency>
67+
68+
<!-- Servlet API -->
69+
<dependency>
70+
<groupId>javax.servlet</groupId>
71+
<artifactId>servlet-api</artifactId>
72+
<version>2.5</version>
73+
<scope>provided</scope>
74+
</dependency>
75+
76+
<!-- JSP API and JSTL
77+
<dependency>
78+
<groupId>javax.servlet.jsp</groupId>
79+
<artifactId>jsp-api</artifactId>
80+
<version>2.1</version>
81+
<scope>provided</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>javax.servlet</groupId>
85+
<artifactId>jstl</artifactId>
86+
<version>1.2</version>
87+
</dependency>
88+
-->
89+
90+
<!-- Apache Tiles
91+
<dependency>
92+
<groupId>org.apache.tiles</groupId>
93+
<artifactId>tiles-jsp</artifactId>
94+
<version>2.1.3</version>
95+
<exclusions>
96+
<exclusion>
97+
<groupId>commons-logging</groupId>
98+
<artifactId>commons-logging-api</artifactId>
99+
</exclusion>
100+
</exclusions>
101+
</dependency>
102+
-->
103+
104+
<!-- JSR 303 with Hibernate Validator
105+
<dependency>
106+
<groupId>javax.validation</groupId>
107+
<artifactId>validation-api</artifactId>
108+
<version>1.0.0.GA</version>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.hibernate</groupId>
112+
<artifactId>hibernate-validator</artifactId>
113+
<version>4.1.0.Final</version>
114+
</dependency>
115+
-->
116+
117+
<!-- Joda Time Library
118+
<dependency>
119+
<groupId>joda-time</groupId>
120+
<artifactId>joda-time</artifactId>
121+
<version>1.6.2</version>
122+
</dependency>
123+
<dependency>
124+
<groupId>joda-time</groupId>
125+
<artifactId>joda-time-jsptags</artifactId>
126+
<version>1.0.2</version>
127+
<scope>runtime</scope>
128+
</dependency>
129+
-->
130+
131+
<!-- Apache Commons File Upload
132+
<dependency>
133+
<groupId>commons-fileupload</groupId>
134+
<artifactId>commons-fileupload</artifactId>
135+
<version>1.2.2</version>
136+
</dependency>
137+
<dependency>
138+
<groupId>commons-io</groupId>
139+
<artifactId>commons-io</artifactId>
140+
<version>2.0.1</version>
141+
</dependency>
142+
-->
143+
144+
<!-- Jackson JSON Processor
145+
<dependency>
146+
<groupId>org.codehaus.jackson</groupId>
147+
<artifactId>jackson-mapper-asl</artifactId>
148+
<version>1.8.1</version>
149+
</dependency>
150+
-->
151+
152+
<!-- Rome Atom+RSS
153+
<dependency>
154+
<groupId>rome</groupId>
155+
<artifactId>rome</artifactId>
156+
<version>1.0</version>
157+
</dependency>
158+
-->
159+
160+
<!-- Test -->
161+
<dependency>
162+
<groupId>junit</groupId>
163+
<artifactId>junit</artifactId>
164+
<version>4.8</version>
165+
<scope>test</scope>
166+
</dependency>
167+
</dependencies>
168+
169+
<repositories>
170+
<repository>
171+
<id>spring-maven-snapshot</id>
172+
<name>Springframework Maven Snapshot Repository</name>
173+
<url>http://repo.springsource.org/snapshot</url>
174+
<snapshots>
175+
<enabled>true</enabled>
176+
</snapshots>
177+
</repository>
178+
</repositories>
179+
180+
<build>
181+
<plugins>
182+
<plugin>
183+
<artifactId>maven-compiler-plugin</artifactId>
184+
<configuration>
185+
<source>${java-version}</source>
186+
<target>${java-version}</target>
187+
</configuration>
188+
</plugin>
189+
<plugin>
190+
<groupId>org.apache.maven.plugins</groupId>
191+
<artifactId>maven-dependency-plugin</artifactId>
192+
<executions>
193+
<execution>
194+
<id>install</id>
195+
<phase>install</phase>
196+
<goals>
197+
<goal>sources</goal>
198+
</goals>
199+
</execution>
200+
</executions>
201+
</plugin>
202+
<plugin>
203+
<groupId>org.apache.maven.plugins</groupId>
204+
<artifactId>maven-eclipse-plugin</artifactId>
205+
<version>2.8</version>
206+
<configuration>
207+
<downloadSources>true</downloadSources>
208+
<downloadJavadocs>false</downloadJavadocs>
209+
<wtpversion>2.0</wtpversion>
210+
</configuration>
211+
</plugin>
212+
<plugin>
213+
<artifactId>maven-surefire-plugin</artifactId>
214+
<configuration>
215+
<includes>
216+
<include>**/*Tests.java</include>
217+
</includes>
218+
<excludes>
219+
<exclude>**/*Abstract*.java</exclude>
220+
</excludes>
221+
</configuration>
222+
</plugin>
223+
</plugins>
224+
</build>
225+
226+
</project>
227+

SPR-9818/src/main/java/org/springframework/issues/.gitignore

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.springframework.issues.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.ComponentScan;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
7+
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
8+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
9+
import org.springframework.web.servlet.view.InternalResourceViewResolver;
10+
11+
@EnableWebMvc
12+
@ComponentScan(basePackages="org.springframework.issues")
13+
@Configuration
14+
public class WebConfig extends WebMvcConfigurerAdapter {
15+
16+
@Override
17+
public void addViewControllers(ViewControllerRegistry registry) {
18+
registry.addViewController("/").setViewName("home");
19+
}
20+
21+
@Bean
22+
public InternalResourceViewResolver viewResolver() {
23+
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
24+
viewResolver.setPrefix("/WEB-INF/views/");
25+
viewResolver.setSuffix(".jsp");
26+
return viewResolver;
27+
}
28+
29+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.springframework.issues.web;
2+
3+
import org.springframework.web.bind.WebDataBinder;
4+
import org.springframework.web.bind.annotation.ControllerAdvice;
5+
import org.springframework.web.bind.annotation.InitBinder;
6+
7+
@ControllerAdvice
8+
public class GlobabDataBinderInitializer {
9+
10+
@InitBinder
11+
public void initDataBinder(WebDataBinder binder) {
12+
System.out.println("In GlobabDataBinderInitializer.initDataBinder method");
13+
binder.setAutoGrowNestedPaths(false);
14+
}
15+
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.springframework.issues.web;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.RequestMapping;
5+
import org.springframework.web.bind.annotation.RequestParam;
6+
import org.springframework.web.bind.annotation.ResponseBody;
7+
8+
@Controller
9+
public class SearchController {
10+
11+
@RequestMapping("/foo")
12+
@ResponseBody
13+
public String search(SearchCriteria criteria, @RequestParam String age) {
14+
return "Searched " + criteria;
15+
}
16+
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.springframework.issues.web;
2+
3+
public class SearchCriteria {
4+
5+
private int age;
6+
7+
public int getAge() {
8+
return age;
9+
}
10+
11+
public void setAge(int age) {
12+
this.age = age;
13+
}
14+
15+
@Override
16+
public String toString() {
17+
return "SearchCriteria [age=" + age + "]";
18+
}
19+
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
log4j.rootCategory=INFO, stdout
2+
3+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5+
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
6+
7+
log4j.category.org.springframework.web=DEBUG
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3+
<html>
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6+
<title>Home</title>
7+
</head>
8+
<body>
9+
<h1>Home</h1>
10+
<hr>
11+
<a href="foo?age=21">/foo?age=21</a>
12+
</body>
13+
</html>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
5+
6+
<context-param>
7+
<param-name>contextClass</param-name>
8+
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
9+
</context-param>
10+
11+
<context-param>
12+
<param-name>contextConfigLocation</param-name>
13+
<param-value>org.springframework.issues.config</param-value>
14+
</context-param>
15+
16+
<listener>
17+
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
18+
</listener>
19+
20+
<servlet>
21+
<servlet-name>appServlet</servlet-name>
22+
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
23+
<init-param>
24+
<param-name>contextConfigLocation</param-name>
25+
<param-value></param-value>
26+
</init-param>
27+
<load-on-startup>1</load-on-startup>
28+
</servlet>
29+
30+
<servlet-mapping>
31+
<servlet-name>appServlet</servlet-name>
32+
<url-pattern>/</url-pattern>
33+
</servlet-mapping>
34+
35+
<!-- Disables Servlet Container welcome file handling. Needed for compatibility
36+
with Servlet 3.0 and Tomcat 7.0 -->
37+
<welcome-file-list>
38+
<welcome-file></welcome-file>
39+
</welcome-file-list>
40+
41+
</web-app>

SPR-9818/src/test/java/org/springframework/issues/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)