Permalink
Browse files

Add SPR-5628 web project

  • Loading branch information...
1 parent 8808447 commit 892a89b23c912fddc8a159866dfa96c5943c91aa @rstoyanchev rstoyanchev committed Jul 13, 2011
View
@@ -0,0 +1,17 @@
+This is a simple template for creating issue reproduction projects per
+the README.markdown file in the root of this repository (and at
+https://github.com/cbeams/spring-framework-issues#readme). Please read
+that document completely before starting.
+
+As described at the link above, copy this project to a new directory
+having the same name as the JIRA issue you're trying to reproduce and
+edit from there.
+
+Both Gradle (build.gradle) and Maven (pom.xml) build scripts are
+included for your convenience and choice. Once you've created your
+copy of this directory, delete whichever build script you don't wish
+to use, and then edit the remaining one to suit your needs.
+
+Note that this project contains a log4j.properties file in
+src/test/resources that you may wish to configure to emit more detailed
+logging. The log level for org.springframework is set to WARN by default.
View
@@ -0,0 +1,24 @@
+group = 'org.springframework.issues'
+version = '1.0.0.SNAPSHOT'
+
+apply plugin: 'java'
+apply plugin: 'eclipse'
+apply plugin: 'idea'
+
+repositories {
+ mavenLocal()
+ mavenCentral()
+ mavenRepo urls: 'http://maven.springframework.org/snapshot'
+}
+
+dependencies {
+ compile 'org.springframework:spring-context:3.1.0.M1'
+ compile 'commons-logging:commons-logging:1.1.1'
+ compile 'log4j:log4j:1.2.16'
+ testCompile 'junit:junit:4.8'
+}
+
+[compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:all']
+
+sourceCompatibility = 1.6
+targetCompatibility = 1.6
View
@@ -0,0 +1,179 @@
+<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-5628</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Test support for using HTTP PUT with form-encoded data</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>
+
+ <!-- Commons HTTP client -->
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.1.1</version>
+ <optional>true</optional>
+ </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,55 @@
+/*
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.util.FileCopyUtils;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+@Controller
+public abstract class AbstractController {
+
+ @RequestMapping(value="/requestParam")
+ @ResponseBody
+ public String requestParam(@RequestParam(required=false) String param) {
+ return "param=" + param;
+ }
+
+ @RequestMapping(value="/requestBody")
+ @ResponseBody
+ public String requestBody(@RequestBody MultiValueMap<String, String> params) {
+ return "params=" + params;
+ }
+
+ @RequestMapping(value="/requestParamAndInputStream")
+ @ResponseBody
+ public String requestParamAndInputStream(@RequestParam(required=false) String param,
+ InputStream input) throws IOException {
+ String content = FileCopyUtils.copyToString(new InputStreamReader(input, Charset.forName("UTF-8")));
+ return "param=" + param + ", content=[" + content + "]";
+ }
+
+}
@@ -0,0 +1,27 @@
+/*
+ * 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.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+@RequestMapping(value="/test", method=RequestMethod.POST)
+public class PostController extends AbstractController {
+
+}
@@ -0,0 +1,27 @@
+/*
+ * 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.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+@RequestMapping(value="/test", method=RequestMethod.PUT)
+public class PutController extends AbstractController {
+
+}
@@ -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,22 @@
+<?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 />
+
+ <mvc:view-controller path="/" view-name="home" />
+
+ <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,11 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<!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>
+</body>
+</html>
Oops, something went wrong.

0 comments on commit 892a89b

Please sign in to comment.