Permalink
Browse files

ADD PROJECT FOR SPR-8661

  • Loading branch information...
1 parent 060c255 commit 7b8501f8d7b88c5a6fff182910beb1ecb86e0e92 @rstoyanchev rstoyanchev committed Sep 12, 2011
View
@@ -35,46 +35,38 @@ For the purpose of these instructions, we'll assume your new JIRA issue ID is "S
#### Steps
-1\. In your local clone of this repository, copy the appopriate 'template' directory. Their names start with `SPR-0000`.
+1\. In your local clone of this repository, create a copy of the appopriate 'template' directory. Their names start with `SPR-0000`.
For Core Spring Framework issues:
```bash
cd spring-framework-issues
-cp -r SPR-0000 SPR-9876
+./create-repro-project.sh SPR-0000/ SPR-9876
```
For Spring MVC issues:
```bash
cd spring-framework-issues
-cp -r SPR-0000-war-xml SPR-9876
+./create-repro-project.sh SPR-0000-war-xml/ SPR-9876
```
-2\. Modify the pom.xml to change the artifactId to your JIRA issue ID.
-
-```xml
-<groupId>org.springframework.issues</groupId>
-<artifactId>SPR-9876</artifactId>
-<version>1.0-SNAPSHOT</version>
-```
-
-3\. Review the list of dependencies and version numbers, uncommenting, adding or deleting as necessary.
+2\. Review the list of dependencies and version numbers and modify the pom.xml as necessary.
-4\. Import the project into your IDE and modify it as necessary to reproduce your issue.
+3\. Import the project into your IDE and modify it as necessary to reproduce your issue.
* It is already a buildable Maven project, so you may use your IDE's built-in support for Maven to do the importing.
-5\. Add, commit, and push your local fork
+4\. Add, commit, and push your local fork
```bash
git add SPR-9876
git commit -m "Add repro project for SPR-9876"
git push
```
-6\. [Send a pull request from the Github web interface](http://help.github.com/send-pull-requests/)
+5\. [Send a pull request from the Github web interface](http://help.github.com/send-pull-requests/)
* The Spring Framework team will be notified and will look at your request
View
@@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.issues</groupId>
- <artifactId>SPR-0000</artifactId>
+ <artifactId>SPR-0000-war-xml</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Spring MVC Issue Reproduction Project</name>
<packaging>war</packaging>
View
@@ -0,0 +1,169 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.springframework.issues</groupId>
+ <artifactId>SPR-8661</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Spring MVC Issue Reproduction Project</name>
+ <packaging>war</packaging>
+
+ <properties>
+ <java-version>1.6</java-version>
+ <org.springframework-version>3.1.0.BUILD-SNAPSHOT</org.springframework-version>
+ <org.slf4j-version>1.6.1</org.slf4j-version>
+ </properties>
+
+ <dependencies>
+ <!-- Spring Framework -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>3.1.0.BUILD-SNAPSHOT</version>
+ <exclusions>
+ <!-- Exclude Commons Logging in favor of SLF4j -->
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>3.1.0.BUILD-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${org.slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${org.slf4j-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Servlet API -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSTL -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <!-- JSR 303 with Hibernate Validator <dependency> <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> </dependency>
+ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId>
+ <version>4.1.0.Final</version> </dependency> -->
+
+ <!-- Joda Time Library <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId>
+ <version>1.6.2</version> </dependency> -->
+
+ <!-- File Upload <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId>
+ <version>1.2.2</version> </dependency> <dependency> <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId> <version>2.0.1</version> </dependency> -->
+
+ <!-- Jackson JSON Processor <dependency> <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId> <version>1.8.1</version> </dependency> -->
+
+ <!-- Rome Atom+RSS <dependency> <groupId>rome</groupId> <artifactId>rome</artifactId>
+ <version>1.0</version> </dependency> -->
+
+ <!-- Test -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>spring-maven-snapshot</id>
+ <name>Springframework Maven Snapshot Repository</name>
+ <url>http://maven.springframework.org/snapshot</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <!-- For Hibernate Validator -->
+ <repository>
+ <id>org.jboss.repository.releases</id>
+ <name>JBoss Maven Release Repository</name>
+ <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <!-- For Rome -->
+ <repository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${java-version}</source>
+ <target>${java-version}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <goals>
+ <goal>sources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*Tests.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2002-2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.web.issues;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+public class HomeController {
+
+ @RequestMapping(value="/", method=RequestMethod.GET)
+ public String show(Model model) {
+ JavaBean javaBean = new JavaBean();
+ javaBean.setText("textValue");
+ javaBean.setHiddenText("hiddenTextValue");
+ model.addAttribute(javaBean);
+ return "home";
+
+ }
+
+ @RequestMapping(value="/", method=RequestMethod.POST)
+ public String show(JavaBean javaBean, Model model) {
+ System.out.println("Text: " + javaBean.getText());
+ System.out.println("HiddenText: " + javaBean.getHiddenText());
+ return "redirect:/";
+ }
+
+}
+
+
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2002-2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.web.issues;
+
+public class JavaBean {
+
+ private String text;
+
+ private String hiddenText;
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getHiddenText() {
+ return hiddenText;
+ }
+
+ public void setHiddenText(String hiddenText) {
+ this.hiddenText = hiddenText;
+ }
+
+}
@@ -0,0 +1,7 @@
+log4j.rootCategory=INFO, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
+
+log4j.category.org.springframework.web=DEBUG
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <!-- Root Context: defines shared resources visible to all other web components -->
+
+</beans>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:mvc="http://www.springframework.org/schema/mvc"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <mvc:annotation-driven />
+
+ <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+ <property name="prefix" value="/WEB-INF/views/" />
+ <property name="suffix" value=".jsp" />
+ </bean>
+
+ <context:component-scan base-package="org.springframework.web.issues" />
+
+</beans>
@@ -0,0 +1,25 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Home</title>
+</head>
+<body>
+ <h1>Home</h1>
+
+ <form:form modelAttribute="javaBean">
+ <p><form:hidden path="hiddenText" disabled="true" /></p>
+ <p><form:input path="text" disabled="true" /></p>
+ <p><input type="submit"></p>
+ </form:form>
+
+ <form:form modelAttribute="javaBean">
+ <p><form:hidden path="hiddenText" disabled="false" /> <!-- disabled is written --> </p>
+ <p><form:input path="text" disabled="false" /> <!-- disabled not written --> </p>
+ <p><input type="submit"></p>
+ </form:form>
+
+</body>
+</html>
Oops, something went wrong.

0 comments on commit 7b8501f

Please sign in to comment.