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

Commit 7b8501f

Browse files
committed
ADD PROJECT FOR SPR-8661
1 parent 060c255 commit 7b8501f

File tree

12 files changed

+375
-16
lines changed

12 files changed

+375
-16
lines changed

README.markdown

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,46 +35,38 @@ For the purpose of these instructions, we'll assume your new JIRA issue ID is "S
3535

3636
#### Steps
3737

38-
1\. In your local clone of this repository, copy the appopriate 'template' directory. Their names start with `SPR-0000`.
38+
1\. In your local clone of this repository, create a copy of the appopriate 'template' directory. Their names start with `SPR-0000`.
3939

4040
For Core Spring Framework issues:
4141

4242
```bash
4343
cd spring-framework-issues
44-
cp -r SPR-0000 SPR-9876
44+
./create-repro-project.sh SPR-0000/ SPR-9876
4545
```
4646

4747
For Spring MVC issues:
4848

4949
```bash
5050
cd spring-framework-issues
51-
cp -r SPR-0000-war-xml SPR-9876
51+
./create-repro-project.sh SPR-0000-war-xml/ SPR-9876
5252
```
5353

54-
2\. Modify the pom.xml to change the artifactId to your JIRA issue ID.
55-
56-
```xml
57-
<groupId>org.springframework.issues</groupId>
58-
<artifactId>SPR-9876</artifactId>
59-
<version>1.0-SNAPSHOT</version>
60-
```
61-
62-
3\. Review the list of dependencies and version numbers, uncommenting, adding or deleting as necessary.
54+
2\. Review the list of dependencies and version numbers and modify the pom.xml as necessary.
6355

6456

65-
4\. Import the project into your IDE and modify it as necessary to reproduce your issue.
57+
3\. Import the project into your IDE and modify it as necessary to reproduce your issue.
6658

6759
* It is already a buildable Maven project, so you may use your IDE's built-in support for Maven to do the importing.
6860

69-
5\. Add, commit, and push your local fork
61+
4\. Add, commit, and push your local fork
7062

7163
```bash
7264
git add SPR-9876
7365
git commit -m "Add repro project for SPR-9876"
7466
git push
7567
```
7668

77-
6\. [Send a pull request from the Github web interface](http://help.github.com/send-pull-requests/)
69+
5\. [Send a pull request from the Github web interface](http://help.github.com/send-pull-requests/)
7870

7971
* The Spring Framework team will be notified and will look at your request
8072

SPR-0000-war-xml/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.springframework.issues</groupId>
5-
<artifactId>SPR-0000</artifactId>
5+
<artifactId>SPR-0000-war-xml</artifactId>
66
<version>1.0-SNAPSHOT</version>
77
<name>Spring MVC Issue Reproduction Project</name>
88
<packaging>war</packaging>

SPR-8661/pom.xml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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-8661</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.1.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>3.1.0.BUILD-SNAPSHOT</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>3.1.0.BUILD-SNAPSHOT</version>
34+
</dependency>
35+
36+
<!-- Logging -->
37+
<dependency>
38+
<groupId>org.slf4j</groupId>
39+
<artifactId>slf4j-api</artifactId>
40+
<version>${org.slf4j-version}</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.slf4j</groupId>
44+
<artifactId>jcl-over-slf4j</artifactId>
45+
<version>${org.slf4j-version}</version>
46+
<scope>runtime</scope>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.slf4j</groupId>
50+
<artifactId>slf4j-log4j12</artifactId>
51+
<version>${org.slf4j-version}</version>
52+
<scope>runtime</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>log4j</groupId>
56+
<artifactId>log4j</artifactId>
57+
<version>1.2.16</version>
58+
<scope>runtime</scope>
59+
</dependency>
60+
61+
<!-- Servlet API -->
62+
<dependency>
63+
<groupId>javax.servlet</groupId>
64+
<artifactId>servlet-api</artifactId>
65+
<version>2.5</version>
66+
<scope>provided</scope>
67+
</dependency>
68+
69+
<!-- JSTL -->
70+
<dependency>
71+
<groupId>javax.servlet</groupId>
72+
<artifactId>jstl</artifactId>
73+
<version>1.2</version>
74+
</dependency>
75+
76+
<!-- JSR 303 with Hibernate Validator <dependency> <groupId>javax.validation</groupId>
77+
<artifactId>validation-api</artifactId> <version>1.0.0.GA</version> </dependency>
78+
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId>
79+
<version>4.1.0.Final</version> </dependency> -->
80+
81+
<!-- Joda Time Library <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId>
82+
<version>1.6.2</version> </dependency> -->
83+
84+
<!-- File Upload <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId>
85+
<version>1.2.2</version> </dependency> <dependency> <groupId>commons-io</groupId>
86+
<artifactId>commons-io</artifactId> <version>2.0.1</version> </dependency> -->
87+
88+
<!-- Jackson JSON Processor <dependency> <groupId>org.codehaus.jackson</groupId>
89+
<artifactId>jackson-mapper-asl</artifactId> <version>1.8.1</version> </dependency> -->
90+
91+
<!-- Rome Atom+RSS <dependency> <groupId>rome</groupId> <artifactId>rome</artifactId>
92+
<version>1.0</version> </dependency> -->
93+
94+
<!-- Test -->
95+
<dependency>
96+
<groupId>junit</groupId>
97+
<artifactId>junit</artifactId>
98+
<version>4.8</version>
99+
<scope>test</scope>
100+
</dependency>
101+
</dependencies>
102+
103+
<repositories>
104+
<repository>
105+
<id>spring-maven-snapshot</id>
106+
<name>Springframework Maven Snapshot Repository</name>
107+
<url>http://maven.springframework.org/snapshot</url>
108+
<snapshots>
109+
<enabled>true</enabled>
110+
</snapshots>
111+
</repository>
112+
<!-- For Hibernate Validator -->
113+
<repository>
114+
<id>org.jboss.repository.releases</id>
115+
<name>JBoss Maven Release Repository</name>
116+
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
117+
<snapshots>
118+
<enabled>false</enabled>
119+
</snapshots>
120+
</repository>
121+
<!-- For Rome -->
122+
<repository>
123+
<id>maven2-repository.dev.java.net</id>
124+
<name>Java.net Repository for Maven</name>
125+
<url>http://download.java.net/maven/2/</url>
126+
<snapshots>
127+
<enabled>false</enabled>
128+
</snapshots>
129+
</repository>
130+
</repositories>
131+
132+
<build>
133+
<plugins>
134+
<plugin>
135+
<artifactId>maven-compiler-plugin</artifactId>
136+
<configuration>
137+
<source>${java-version}</source>
138+
<target>${java-version}</target>
139+
</configuration>
140+
</plugin>
141+
<plugin>
142+
<groupId>org.apache.maven.plugins</groupId>
143+
<artifactId>maven-dependency-plugin</artifactId>
144+
<executions>
145+
<execution>
146+
<id>install</id>
147+
<phase>install</phase>
148+
<goals>
149+
<goal>sources</goal>
150+
</goals>
151+
</execution>
152+
</executions>
153+
</plugin>
154+
<plugin>
155+
<artifactId>maven-surefire-plugin</artifactId>
156+
<configuration>
157+
<includes>
158+
<include>**/*Tests.java</include>
159+
</includes>
160+
<excludes>
161+
<exclude>**/*Abstract*.java</exclude>
162+
</excludes>
163+
</configuration>
164+
</plugin>
165+
</plugins>
166+
</build>
167+
168+
</project>
169+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2002-2011 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.web.issues;
18+
19+
import org.springframework.stereotype.Controller;
20+
import org.springframework.ui.Model;
21+
import org.springframework.web.bind.annotation.RequestMapping;
22+
import org.springframework.web.bind.annotation.RequestMethod;
23+
24+
@Controller
25+
public class HomeController {
26+
27+
@RequestMapping(value="/", method=RequestMethod.GET)
28+
public String show(Model model) {
29+
JavaBean javaBean = new JavaBean();
30+
javaBean.setText("textValue");
31+
javaBean.setHiddenText("hiddenTextValue");
32+
model.addAttribute(javaBean);
33+
return "home";
34+
35+
}
36+
37+
@RequestMapping(value="/", method=RequestMethod.POST)
38+
public String show(JavaBean javaBean, Model model) {
39+
System.out.println("Text: " + javaBean.getText());
40+
System.out.println("HiddenText: " + javaBean.getHiddenText());
41+
return "redirect:/";
42+
}
43+
44+
}
45+
46+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2002-2011 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.web.issues;
18+
19+
public class JavaBean {
20+
21+
private String text;
22+
23+
private String hiddenText;
24+
25+
public String getText() {
26+
return text;
27+
}
28+
29+
public void setText(String text) {
30+
this.text = text;
31+
}
32+
33+
public String getHiddenText() {
34+
return hiddenText;
35+
}
36+
37+
public void setHiddenText(String hiddenText) {
38+
this.hiddenText = hiddenText;
39+
}
40+
41+
}
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="
5+
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
6+
7+
<!-- Root Context: defines shared resources visible to all other web components -->
8+
9+
</beans>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:mvc="http://www.springframework.org/schema/mvc"
5+
xmlns:context="http://www.springframework.org/schema/context"
6+
xsi:schemaLocation="
7+
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
8+
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
9+
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
10+
11+
<mvc:annotation-driven />
12+
13+
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
14+
<property name="prefix" value="/WEB-INF/views/" />
15+
<property name="suffix" value=".jsp" />
16+
</bean>
17+
18+
<context:component-scan base-package="org.springframework.web.issues" />
19+
20+
</beans>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
2+
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
3+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4+
<html>
5+
<head>
6+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7+
<title>Home</title>
8+
</head>
9+
<body>
10+
<h1>Home</h1>
11+
12+
<form:form modelAttribute="javaBean">
13+
<p><form:hidden path="hiddenText" disabled="true" /></p>
14+
<p><form:input path="text" disabled="true" /></p>
15+
<p><input type="submit"></p>
16+
</form:form>
17+
18+
<form:form modelAttribute="javaBean">
19+
<p><form:hidden path="hiddenText" disabled="false" /> <!-- disabled is written --> </p>
20+
<p><form:input path="text" disabled="false" /> <!-- disabled not written --> </p>
21+
<p><input type="submit"></p>
22+
</form:form>
23+
24+
</body>
25+
</html>

0 commit comments

Comments
 (0)