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

Commit 3607fae

Browse files
committed
Merge pull request #107 from kazuki43zoo/SPR-13503
Add repro project for SPR-13503
2 parents 5bf23a0 + 4320bbc commit 3607fae

File tree

15 files changed

+627
-0
lines changed

15 files changed

+627
-0
lines changed

SPR-13503/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Repro project for SPR-0000-war-java
2+
3+
The project will be available at: http://localhost:8080/SPR-0000-war-java/
4+
5+
## Deploying
6+
7+
It is possible to deploy your application directly from the command-line
8+
using maven. You can use either [cargo](http://cargo.codehaus.org/) or
9+
the [jetty plugin](http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html)
10+
to run on a wide range of containers.
11+
12+
### Cargo
13+
14+
By default Cargo is configured to start `Tomcat7` and can be invoked by
15+
running `mvn package cargo:run`. Cargo can also run a [wide range of other
16+
containers](http://cargo.codehaus.org/Containers) and you can easily add
17+
yours by editing the `pom.xml`. For instance, a `tomcat8` profile
18+
has been added and can be invoked via `mvn package cargo:run -Ptomcat8`.
19+
20+
You can remote debug the application, in your IDE, by using the following command:
21+
`mvn package cargo:run -Ptomcat8 -Pdebug`. Note that you can customize the debug
22+
port used with the `cargo.jvm.debug.port` maven property.
23+
24+
### Jetty
25+
26+
To deploy your application to jetty9, simply invoke `mvn jetty:run`. It
27+
is possible to tune the exact jetty9 version you want to use by specifying
28+
the version of the command line, e.g. `mvn jetty:run -Djetty.version=9.0.6.v20130930`
29+
30+
To run a different version of jetty, please fallback to cargo as the
31+
coordinates of the maven plugin have changed. A sample `jetty8` profile is
32+
created for reference and can be tuned to suit your needs. To deploy your
33+
sample application to jetty8 run `mvn cargo:run -Pjetty8`
34+
35+
## Logging
36+
37+
This project contains a `log4j.properties` file in `src/main/resources` that you
38+
may wish to configure to emit more detailed logging. The root logger is set to
39+
`INFO` and a custom `org.springframework.web` logger is set to `DEBUG`.
40+
41+

SPR-13503/pom.xml

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
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-13503</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>Spring MVC Issue Reproduction Project</name>
8+
<packaging>war</packaging>
9+
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
13+
<java.version>1.6</java.version>
14+
<spring.version>4.2.1.RELEASE</spring.version>
15+
<slf4j.version>1.7.5</slf4j.version>
16+
17+
<jetty.version>9.1.2.v20140210</jetty.version>
18+
<cargo.container.id>tomcat7x</cargo.container.id>
19+
<cargo.container.url>http://www.eu.apache.org/dist/tomcat/tomcat-7/v7.0.64/bin/apache-tomcat-7.0.64.zip</cargo.container.url>
20+
<cargo.container.jvmargs>-Xms96m -Xmx512m -Djava.awt.headless=true</cargo.container.jvmargs>
21+
<cargo.jvm.debug.port>8000</cargo.jvm.debug.port>
22+
</properties>
23+
24+
<dependencies>
25+
<!-- Spring Framework -->
26+
<dependency>
27+
<groupId>org.springframework</groupId>
28+
<artifactId>spring-context</artifactId>
29+
<version>${spring.version}</version>
30+
<exclusions>
31+
<!-- Exclude Commons Logging in favor of SLF4j -->
32+
<exclusion>
33+
<groupId>commons-logging</groupId>
34+
<artifactId>commons-logging</artifactId>
35+
</exclusion>
36+
</exclusions>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.springframework</groupId>
40+
<artifactId>spring-webmvc</artifactId>
41+
<version>${spring.version}</version>
42+
</dependency>
43+
44+
<!-- Logging -->
45+
<dependency>
46+
<groupId>org.slf4j</groupId>
47+
<artifactId>slf4j-api</artifactId>
48+
<version>${slf4j.version}</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.slf4j</groupId>
52+
<artifactId>jcl-over-slf4j</artifactId>
53+
<version>${slf4j.version}</version>
54+
<scope>runtime</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.slf4j</groupId>
58+
<artifactId>slf4j-log4j12</artifactId>
59+
<version>${slf4j.version}</version>
60+
<scope>runtime</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>log4j</groupId>
64+
<artifactId>log4j</artifactId>
65+
<version>1.2.17</version>
66+
<scope>runtime</scope>
67+
</dependency>
68+
69+
<!-- Servlet API -->
70+
<dependency>
71+
<groupId>javax.servlet</groupId>
72+
<artifactId>servlet-api</artifactId>
73+
<version>2.5</version>
74+
<scope>provided</scope>
75+
</dependency>
76+
77+
<!-- JSP API
78+
<dependency>
79+
<groupId>javax.servlet.jsp</groupId>
80+
<artifactId>jsp-api</artifactId>
81+
<version>2.1</version>
82+
<scope>provided</scope>
83+
</dependency>
84+
-->
85+
<dependency>
86+
<groupId>javax.servlet</groupId>
87+
<artifactId>jstl</artifactId>
88+
<version>1.2</version>
89+
</dependency>
90+
91+
<!-- Apache Tiles
92+
<dependency>
93+
<groupId>org.apache.tiles</groupId>
94+
<artifactId>tiles-jsp</artifactId>
95+
<version>2.1.3</version>
96+
<exclusions>
97+
<exclusion>
98+
<groupId>commons-logging</groupId>
99+
<artifactId>commons-logging-api</artifactId>
100+
</exclusion>
101+
</exclusions>
102+
</dependency>
103+
-->
104+
105+
<!-- JSR 303 with Hibernate Validator
106+
<dependency>
107+
<groupId>javax.validation</groupId>
108+
<artifactId>validation-api</artifactId>
109+
<version>1.0.0.GA</version>
110+
</dependency>
111+
<dependency>
112+
<groupId>org.hibernate</groupId>
113+
<artifactId>hibernate-validator</artifactId>
114+
<version>4.1.0.Final</version>
115+
</dependency>
116+
-->
117+
118+
<!-- Joda Time Library
119+
<dependency>
120+
<groupId>joda-time</groupId>
121+
<artifactId>joda-time</artifactId>
122+
<version>1.6.2</version>
123+
</dependency>
124+
<dependency>
125+
<groupId>joda-time</groupId>
126+
<artifactId>joda-time-jsptags</artifactId>
127+
<version>1.0.2</version>
128+
<scope>runtime</scope>
129+
</dependency>
130+
-->
131+
132+
<!-- Apache Commons File Upload
133+
<dependency>
134+
<groupId>commons-fileupload</groupId>
135+
<artifactId>commons-fileupload</artifactId>
136+
<version>1.2.2</version>
137+
</dependency>
138+
<dependency>
139+
<groupId>commons-io</groupId>
140+
<artifactId>commons-io</artifactId>
141+
<version>2.0.1</version>
142+
</dependency>
143+
-->
144+
145+
<!-- Jackson JSON Processor
146+
<dependency>
147+
<groupId>com.fasterxml.jackson.core</groupId>
148+
<artifactId>jackson-databind</artifactId>
149+
<version>2.4.3</version>
150+
</dependency>
151+
-->
152+
153+
<!-- Rome Atom+RSS
154+
<dependency>
155+
<groupId>rome</groupId>
156+
<artifactId>rome</artifactId>
157+
<version>1.0</version>
158+
</dependency>
159+
-->
160+
161+
<!-- Test -->
162+
<dependency>
163+
<groupId>junit</groupId>
164+
<artifactId>junit</artifactId>
165+
<version>4.11</version>
166+
<scope>test</scope>
167+
</dependency>
168+
<dependency>
169+
<groupId>org.seleniumhq.selenium</groupId>
170+
<artifactId>selenium-java</artifactId>
171+
<version>2.47.1</version>
172+
<scope>test</scope>
173+
</dependency>
174+
175+
</dependencies>
176+
177+
<build>
178+
<plugins>
179+
<plugin>
180+
<groupId>org.apache.maven.plugins</groupId>
181+
<artifactId>maven-compiler-plugin</artifactId>
182+
<version>2.5.1</version>
183+
<configuration>
184+
<source>${java.version}</source>
185+
<target>${java.version}</target>
186+
</configuration>
187+
</plugin>
188+
<plugin>
189+
<groupId>org.apache.maven.plugins</groupId>
190+
<artifactId>maven-dependency-plugin</artifactId>
191+
<version>2.8</version>
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+
<groupId>org.apache.maven.plugins</groupId>
214+
<artifactId>maven-surefire-plugin</artifactId>
215+
<version>2.12.4</version>
216+
<configuration>
217+
<includes>
218+
<include>**/*Tests.java</include>
219+
<include>**/*Test.java</include>
220+
</includes>
221+
<excludes>
222+
<exclude>**/*Abstract*.java</exclude>
223+
</excludes>
224+
</configuration>
225+
</plugin>
226+
<plugin>
227+
<groupId>org.eclipse.jetty</groupId>
228+
<artifactId>jetty-maven-plugin</artifactId>
229+
<version>${jetty.version}</version>
230+
</plugin>
231+
<plugin>
232+
<groupId>org.codehaus.cargo</groupId>
233+
<artifactId>cargo-maven2-plugin</artifactId>
234+
<version>1.4.7</version>
235+
<configuration>
236+
<configuration>
237+
<properties>
238+
<cargo.servlet.port>8080</cargo.servlet.port>
239+
<cargo.tomcat.ajp.port>1099</cargo.tomcat.ajp.port>
240+
<cargo.rmi.port>1099</cargo.rmi.port>
241+
<cargo.logging>medium</cargo.logging>
242+
<cargo.jvmargs>${cargo.container.jvmargs}</cargo.jvmargs>
243+
</properties>
244+
</configuration>
245+
<container>
246+
<containerId>${cargo.container.id}</containerId>
247+
<zipUrlInstaller>
248+
<url>${cargo.container.url}</url>
249+
</zipUrlInstaller>
250+
</container>
251+
</configuration>
252+
</plugin>
253+
</plugins>
254+
</build>
255+
256+
<profiles>
257+
<profile>
258+
<id>tomcat8</id>
259+
<properties>
260+
<cargo.container.id>tomcat8x</cargo.container.id>
261+
<cargo.container.url>http://www.eu.apache.org/dist/tomcat/tomcat-8/v8.0.26/bin/apache-tomcat-8.0.26.zip</cargo.container.url>
262+
</properties>
263+
</profile>
264+
<profile>
265+
<id>jetty8</id>
266+
<build>
267+
<plugins>
268+
<plugin>
269+
<groupId>org.codehaus.cargo</groupId>
270+
<artifactId>cargo-maven2-plugin</artifactId>
271+
<configuration>
272+
<container>
273+
<containerId>jetty8x</containerId>
274+
<type>embedded</type>
275+
</container>
276+
</configuration>
277+
</plugin>
278+
</plugins>
279+
</build>
280+
</profile>
281+
<profile>
282+
<id>debug</id>
283+
<properties>
284+
<cargo.container.jvmargs>
285+
-Xdebug
286+
-Xrunjdwp:transport=dt_socket,address=${cargo.jvm.debug.port},suspend=n,server=y
287+
-Xnoagent
288+
-Djava.compiler=NONE
289+
</cargo.container.jvmargs>
290+
</properties>
291+
</profile>
292+
</profiles>
293+
294+
<repositories>
295+
<repository>
296+
<id>spring-maven-snapshot</id>
297+
<name>Springframework Maven Snapshot Repository</name>
298+
<url>http://repo.spring.io/snapshot</url>
299+
<snapshots>
300+
<enabled>true</enabled>
301+
</snapshots>
302+
</repository>
303+
</repositories>
304+
305+
</project>
306+

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

Whitespace-only changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package org.springframework.issues.app;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.ModelAttribute;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RequestMethod;
7+
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
8+
9+
@RequestMapping("echo")
10+
@Controller
11+
public class EchoController {
12+
13+
@ModelAttribute
14+
public EchoForm setUpForm() {
15+
return new EchoForm();
16+
}
17+
18+
@RequestMapping(method = RequestMethod.GET)
19+
public String form() {
20+
return "form";
21+
}
22+
23+
@RequestMapping(method = RequestMethod.POST, params = "confirm")
24+
public String confirm(EchoForm form) {
25+
return "confirm";
26+
}
27+
28+
@RequestMapping(method = RequestMethod.POST, params = "redo")
29+
public String redo(EchoForm form) {
30+
return "form";
31+
}
32+
33+
@RequestMapping(method = RequestMethod.POST)
34+
public String echo(EchoForm form, RedirectAttributes redirectAttributes) {
35+
redirectAttributes.addFlashAttribute("text1", form.getText1());
36+
redirectAttributes.addFlashAttribute("text2", form.getText2());
37+
return "redirect:/echo?complete";
38+
}
39+
40+
@RequestMapping(method = RequestMethod.GET, params = "complete")
41+
public String echoComplete() {
42+
return "complete";
43+
}
44+
45+
}

0 commit comments

Comments
 (0)