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

Commit cdde05b

Browse files
committed
Add prototype for SPR-13742
1 parent 9925098 commit cdde05b

File tree

13 files changed

+694
-0
lines changed

13 files changed

+694
-0
lines changed

SPR-13742/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Spring MVC project with Java config
2+
3+
This is a simple template for creating issue reproduction projects per
4+
the [README in the root of this repository](https://github.com/spring-projects/spring-framework-issues#readme).
5+
Please review that document before starting.
6+
7+
As described at the link above, do not edit this project directly! Rather
8+
use the `./create-repro-project.sh` script to create a fresh copy to
9+
a new directory having the same name as the JIRA issue you're trying
10+
to reproduce and edit from there.
11+
12+
## Deploying
13+
14+
It is possible to deploy your application directly from the command-line
15+
using maven. See the next two sections on Cargo and Jetty.
16+
17+
### Cargo
18+
19+
You can deploy with the [Cargo Maven plugin](http://cargo.codehaus.org/) which
20+
supports a wide [range of servers](http://cargo.codehaus.org/Containers).
21+
The required command is `mvn package cargo:run`.
22+
23+
By default Cargo is configured to start with `Tomcat 8` but you can easily
24+
edit the plugin settings in `pom.xml` to switch to a different server
25+
and version. The pom.xml or to switch to debug settings.
26+
27+
### Jetty
28+
29+
You can also deploy with the
30+
[Jetty Maven plugin](http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html).
31+
The required command is `mvn jetty:run` or `mvnDebug jetty:run`.
32+
33+
## Logging
34+
35+
This project contains a `log4j.properties` file in `src/main/resources` that you
36+
may wish to configure to emit more detailed logging. The root logger is set to
37+
`INFO` and a custom `org.springframework.web` logger is set to `DEBUG`.

SPR-13742/pom.xml

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
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-13742</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+
<java.version>1.6</java.version>
13+
<spring.version>4.3.0.BUILD-SNAPSHOT</spring.version>
14+
<slf4j.version>1.7.12</slf4j.version>
15+
</properties>
16+
17+
<dependencies>
18+
<!-- Spring Framework -->
19+
<dependency>
20+
<groupId>org.springframework</groupId>
21+
<artifactId>spring-context</artifactId>
22+
<version>${spring.version}</version>
23+
<exclusions>
24+
<!-- Exclude Commons Logging in favor of SLF4j -->
25+
<exclusion>
26+
<groupId>commons-logging</groupId>
27+
<artifactId>commons-logging</artifactId>
28+
</exclusion>
29+
</exclusions>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework</groupId>
33+
<artifactId>spring-webmvc</artifactId>
34+
<version>${spring.version}</version>
35+
</dependency>
36+
37+
<!-- Logging -->
38+
<dependency>
39+
<groupId>org.slf4j</groupId>
40+
<artifactId>slf4j-api</artifactId>
41+
<version>${slf4j.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.slf4j</groupId>
45+
<artifactId>jcl-over-slf4j</artifactId>
46+
<version>${slf4j.version}</version>
47+
<scope>runtime</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.slf4j</groupId>
51+
<artifactId>slf4j-log4j12</artifactId>
52+
<version>${slf4j.version}</version>
53+
<scope>runtime</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>log4j</groupId>
57+
<artifactId>log4j</artifactId>
58+
<version>1.2.17</version>
59+
<scope>runtime</scope>
60+
</dependency>
61+
62+
<!-- Servlet API -->
63+
<dependency>
64+
<groupId>javax.servlet</groupId>
65+
<artifactId>javax.servlet-api</artifactId>
66+
<version>3.0.1</version>
67+
<scope>provided</scope>
68+
</dependency>
69+
70+
<!-- JSP API and JSTL
71+
<dependency>
72+
<groupId>javax.servlet.jsp</groupId>
73+
<artifactId>jsp-api</artifactId>
74+
<version>2.1</version>
75+
<scope>provided</scope>
76+
</dependency>
77+
<dependency>
78+
<groupId>javax.servlet</groupId>
79+
<artifactId>jstl</artifactId>
80+
<version>1.2</version>
81+
</dependency>
82+
-->
83+
84+
<!-- Apache Tiles
85+
<dependency>
86+
<groupId>org.apache.tiles</groupId>
87+
<artifactId>tiles-jsp</artifactId>
88+
<version>2.1.3</version>
89+
<exclusions>
90+
<exclusion>
91+
<groupId>commons-logging</groupId>
92+
<artifactId>commons-logging-api</artifactId>
93+
</exclusion>
94+
</exclusions>
95+
</dependency>
96+
-->
97+
98+
<!-- JSR 303 with Hibernate Validator
99+
<dependency>
100+
<groupId>javax.validation</groupId>
101+
<artifactId>validation-api</artifactId>
102+
<version>1.0.0.GA</version>
103+
</dependency>
104+
<dependency>
105+
<groupId>org.hibernate</groupId>
106+
<artifactId>hibernate-validator</artifactId>
107+
<version>4.1.0.Final</version>
108+
</dependency>
109+
-->
110+
111+
<!-- Joda Time Library
112+
<dependency>
113+
<groupId>joda-time</groupId>
114+
<artifactId>joda-time</artifactId>
115+
<version>1.6.2</version>
116+
</dependency>
117+
<dependency>
118+
<groupId>joda-time</groupId>
119+
<artifactId>joda-time-jsptags</artifactId>
120+
<version>1.0.2</version>
121+
<scope>runtime</scope>
122+
</dependency>
123+
-->
124+
125+
<!-- Apache Commons File Upload
126+
<dependency>
127+
<groupId>commons-fileupload</groupId>
128+
<artifactId>commons-fileupload</artifactId>
129+
<version>1.2.2</version>
130+
</dependency>
131+
<dependency>
132+
<groupId>commons-io</groupId>
133+
<artifactId>commons-io</artifactId>
134+
<version>2.0.1</version>
135+
</dependency>
136+
-->
137+
138+
<dependency>
139+
<groupId>com.fasterxml.jackson.core</groupId>
140+
<artifactId>jackson-databind</artifactId>
141+
<version>2.6.2</version>
142+
</dependency>
143+
144+
<!-- Rome Atom+RSS
145+
<dependency>
146+
<groupId>rome</groupId>
147+
<artifactId>rome</artifactId>
148+
<version>1.0</version>
149+
</dependency>
150+
-->
151+
152+
<dependency>
153+
<groupId>org.apache.httpcomponents</groupId>
154+
<artifactId>httpclient</artifactId>
155+
<version>4.5.1</version>
156+
</dependency>
157+
158+
<!-- Test -->
159+
<dependency>
160+
<groupId>junit</groupId>
161+
<artifactId>junit</artifactId>
162+
<version>4.12</version>
163+
<scope>test</scope>
164+
</dependency>
165+
<dependency>
166+
<groupId>org.springframework</groupId>
167+
<artifactId>spring-test</artifactId>
168+
<version>${spring.version}</version>
169+
</dependency>
170+
171+
</dependencies>
172+
173+
<build>
174+
<plugins>
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-compiler-plugin</artifactId>
178+
<version>2.5.1</version>
179+
<configuration>
180+
<source>${java.version}</source>
181+
<target>${java.version}</target>
182+
</configuration>
183+
</plugin>
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-dependency-plugin</artifactId>
187+
<version>2.8</version>
188+
<executions>
189+
<execution>
190+
<id>install</id>
191+
<phase>install</phase>
192+
<goals>
193+
<goal>sources</goal>
194+
</goals>
195+
</execution>
196+
</executions>
197+
</plugin>
198+
<plugin>
199+
<groupId>org.apache.maven.plugins</groupId>
200+
<artifactId>maven-eclipse-plugin</artifactId>
201+
<version>2.8</version>
202+
<configuration>
203+
<downloadSources>true</downloadSources>
204+
<downloadJavadocs>false</downloadJavadocs>
205+
<wtpversion>2.0</wtpversion>
206+
</configuration>
207+
</plugin>
208+
<plugin>
209+
<groupId>org.apache.maven.plugins</groupId>
210+
<artifactId>maven-surefire-plugin</artifactId>
211+
<version>2.12.4</version>
212+
<configuration>
213+
<includes>
214+
<include>**/*Tests.java</include>
215+
<include>**/*Test.java</include>
216+
</includes>
217+
<excludes>
218+
<exclude>**/*Abstract*.java</exclude>
219+
</excludes>
220+
</configuration>
221+
</plugin>
222+
<plugin>
223+
<groupId>org.eclipse.jetty</groupId>
224+
<artifactId>jetty-maven-plugin</artifactId>
225+
<version>9.3.3.v20150827</version>
226+
</plugin>
227+
<plugin>
228+
<groupId>org.codehaus.cargo</groupId>
229+
<artifactId>cargo-maven2-plugin</artifactId>
230+
<version>1.4.7</version>
231+
<configuration>
232+
<configuration>
233+
<properties>
234+
<cargo.servlet.port>8080</cargo.servlet.port>
235+
<cargo.logging>medium</cargo.logging>
236+
<cargo.jvmargs>-Xms96m -Xmx512m -Djava.awt.headless=true</cargo.jvmargs>
237+
<!--
238+
<cargo.jvmargs>
239+
-Xdebug
240+
-Xrunjdwp:transport=dt_socket,address=8000,suspend=n,server=y
241+
-Xnoagent
242+
-Djava.compiler=NONE
243+
</cargo.jvmargs>
244+
-->
245+
</properties>
246+
</configuration>
247+
<container>
248+
<containerId>tomcat8x</containerId>
249+
<zipUrlInstaller>
250+
<url>http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.26/bin/apache-tomcat-8.0.26.zip</url>
251+
</zipUrlInstaller>
252+
</container>
253+
</configuration>
254+
</plugin>
255+
</plugins>
256+
</build>
257+
258+
<repositories>
259+
<repository>
260+
<id>spring-maven-snapshot</id>
261+
<name>Springframework Maven Snapshot Repository</name>
262+
<url>http://repo.spring.io/snapshot</url>
263+
<snapshots>
264+
<enabled>true</enabled>
265+
</snapshots>
266+
</repository>
267+
</repositories>
268+
269+
</project>
270+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2002-2016 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+
package org.springframework.issues.config;
17+
18+
import java.lang.annotation.Documented;
19+
import java.lang.annotation.ElementType;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
import java.lang.annotation.Target;
23+
24+
25+
/**
26+
* An annotation with the combined semantics of
27+
* {@code @RequestBody(required=false)} and {@code @ModelAttribute}.
28+
*
29+
* <p>If the request has a body, then an attempt will be made to resolve the
30+
* argument as an {@code @RequestBody}-annotated method parameter. If the
31+
* argument remains unresolved, then an attempt is made to resolve the argument
32+
* as an {@code @ModelAttribute}-annotated method parameter.
33+
*/
34+
@Target(ElementType.PARAMETER)
35+
@Retention(RetentionPolicy.RUNTIME)
36+
@Documented
37+
public @interface RequestBodyModelAttribute {
38+
39+
}

0 commit comments

Comments
 (0)