Permalink
Browse files

Initial checkin, matching the original code attached to the JIRA tick…

…et on 27/Mar/11. Includes the source code from both zip files - spring-webmvc-spr-7943.zip and mvc-showcase-spr-7943.zip. Modified Spring MVC classes with names ending on Spr7943 have been renamed to their normal names -- since they're included in the project they take precedence over the same named classes in the jar dependencies.
  • Loading branch information...
1 parent 9a4001c commit 880844779926500cdcf59fea1eded000e1b718e8 @rstoyanchev rstoyanchev committed Jul 12, 2011
Showing with 14,113 additions and 0 deletions.
  1. +277 −0 SPR-7943/pom.xml
  2. +17 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/AjaxUtils.java
  3. +54 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/ConvertController.java
  4. +17 −0 ...943/src/main/java/org/springframework/samples/mvc/convert/CustomConversionServiceFactoryBean.java
  5. +63 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/JavaBean.java
  6. +68 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/JavaBean_Roo_JavaBean.aj
  7. +14 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/MaskFormat.java
  8. +56 −0 ...3/src/main/java/org/springframework/samples/mvc/convert/MaskFormatAnnotationFormatterFactory.java
  9. +33 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/NestedBean.java
  10. +34 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/NestedBean_Roo_JavaBean.aj
  11. +23 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/SocialSecurityNumber.java
  12. +13 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/convert/SocialSecurityNumber_Roo_ToString.aj
  13. +16 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/data/JavaBean.java
  14. +31 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/data/JavaBean_Roo_JavaBean.aj
  15. +15 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/data/JavaBean_Roo_ToString.aj
  16. +53 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/data/RequestDataController.java
  17. +55 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/data/custom/CustomArgumentController.java
  18. +14 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/data/custom/RequestAttribute.java
  19. +71 −0 ...7943/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java
  20. +21 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/exceptions/ExceptionController.java
  21. +35 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/fileupload/FileUploadController.java
  22. +86 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/flash/FlashMap.java
  23. +36 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/flash/FlashMapFilter.java
  24. +84 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/form/FormBean.java
  25. +99 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/form/FormBean_Roo_JavaBean.aj
  26. +51 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/form/FormController.java
  27. +5 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/form/InquiryType.java
  28. +47 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/mapping/ClasslevelMappingController.java
  29. +46 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/mapping/MappingController.java
  30. +17 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean.java
  31. +23 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean_Roo_JavaBean.aj
  32. +14 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean_Roo_ToString.aj
  33. +101 −0 .../src/main/java/org/springframework/samples/mvc/messageconverters/MessageConvertersController.java
  34. +34 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/response/ResponseController.java
  35. +15 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/simple/SimpleController.java
  36. +16 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/simple/SimpleControllerRevisited.java
  37. +27 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/validation/JavaBean.java
  38. +24 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/validation/JavaBean_Roo_JavaBean.aj
  39. +14 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/validation/JavaBean_Roo_ToString.aj
  40. +24 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/validation/ValidationController.java
  41. +25 −0 SPR-7943/src/main/java/org/springframework/samples/mvc/views/ViewsController.java
  42. +1,194 −0 SPR-7943/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
  43. +92 −0 SPR-7943/src/main/java/org/springframework/web/servlet/ParameterHandler.java
  44. +166 −0 SPR-7943/src/main/java/org/springframework/web/servlet/support/RequestContextUtils.java
  45. +123 −0 SPR-7943/src/main/java/org/springframework/web/servlet/tags/DefaultParameterHandler.java
  46. +306 −0 SPR-7943/src/main/java/org/springframework/web/servlet/tags/UrlTag.java
  47. +508 −0 SPR-7943/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
  48. +74 −0 SPR-7943/src/main/java/org/springframework/web/servlet/tags/form/HiddenInputTag.java
  49. +9 −0 SPR-7943/src/main/resources/log4j.properties
  50. +24 −0 SPR-7943/src/main/resources/org/springframework/web/servlet/DispatcherServlet.properties
  51. +15 −0 SPR-7943/src/main/webapp/WEB-INF/spring/appServlet/controllers.xml
  52. +32 −0 SPR-7943/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml
  53. +8 −0 SPR-7943/src/main/webapp/WEB-INF/spring/root-context.xml
  54. +41 −0 SPR-7943/src/main/webapp/WEB-INF/views/fileupload.jsp
  55. +114 −0 SPR-7943/src/main/webapp/WEB-INF/views/form.jsp
  56. +479 −0 SPR-7943/src/main/webapp/WEB-INF/views/home.jsp
  57. +11 −0 SPR-7943/src/main/webapp/WEB-INF/views/views/html.jsp
  58. +11 −0 SPR-7943/src/main/webapp/WEB-INF/views/views/viewName.jsp
  59. +51 −0 SPR-7943/src/main/webapp/WEB-INF/web.xml
  60. +100 −0 SPR-7943/src/main/webapp/resources/form.css
  61. +6,240 −0 SPR-7943/src/main/webapp/resources/jquery/1.4/jquery.js
  62. +675 −0 SPR-7943/src/main/webapp/resources/jqueryform/2.4/jquery.form.js
  63. +216 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/jquery.ui.core.js
  64. +729 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/jquery.ui.tabs.js
  65. +236 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/jquery.ui.widget.js
  66. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-anim_basic_16x16.gif
  67. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png
  68. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_flat_75_ffffff_40x100.png
  69. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png
  70. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_65_ffffff_1x400.png
  71. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_75_dadada_1x400.png
  72. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png
  73. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png
  74. BIN ...rc/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  75. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_222222_256x240.png
  76. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_2e83ff_256x240.png
  77. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_454545_256x240.png
  78. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_888888_256x240.png
  79. BIN SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_cd0a0a_256x240.png
  80. +2 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.all.css
  81. +2 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.base.css
  82. +37 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.core.css
  83. +11 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.tabs.css
  84. +247 −0 SPR-7943/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.theme.css
  85. +482 −0 SPR-7943/src/main/webapp/resources/json2.js
  86. BIN SPR-7943/src/main/webapp/resources/messages/error.png
  87. BIN SPR-7943/src/main/webapp/resources/messages/info.png
  88. +54 −0 SPR-7943/src/main/webapp/resources/messages/messages.css
  89. BIN SPR-7943/src/main/webapp/resources/messages/success.png
  90. BIN SPR-7943/src/main/webapp/resources/messages/warning.png
  91. +15 −0 SPR-7943/src/test/java/org/springframework/samples/mvc/testing/SimpleControllerTests.java
  92. +41 −0 SPR-7943/src/test/resources/log4j.xml
View
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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.samples</groupId>
+ <artifactId>SPR-7943</artifactId>
+ <name>mvc-showcase with HDIV integration</name>
+ <packaging>war</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <java-version>1.6</java-version>
+ <org.springframework-version>3.1.0.BUILD-SNAPSHOT</org.springframework-version>
+ <org.springframework.roo-version>1.1.5.RELEASE</org.springframework.roo-version>
+ <org.aspectj-version>1.6.9</org.aspectj-version>
+ <org.slf4j-version>1.6.1</org.slf4j-version>
+ </properties>
+
+ <dependencies>
+ <!-- Spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${org.springframework-version}</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-web</artifactId>
+ <version>${org.springframework-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${org.springframework-version}</version>
+ </dependency>
+ <!-- Roo dependencies -->
+ <dependency>
+ <groupId>org.springframework.roo</groupId>
+ <artifactId>org.springframework.roo.annotations</artifactId>
+ <version>${org.springframework.roo-version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- AspectJ -->
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${org.aspectj-version}</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>
+ </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>
+
+ <!-- @Inject -->
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+
+ <!-- Servlet -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <!-- Jackson JSON Processor -->
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.6.4</version>
+ </dependency>
+
+ <!-- Rome Atom+RSS -->
+ <dependency>
+ <groupId>rome</groupId>
+ <artifactId>rome</artifactId>
+ <version>1.0</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.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ <!-- Test -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <repositories>
+ <!-- For testing against latest Spring snapshots -->
+ <repository>
+ <id>org.springframework.maven.snapshot</id>
+ <name>Spring Maven Snapshot Repository</name>
+ <url>http://maven.springframework.org/snapshot</url>
+ <releases><enabled>false</enabled></releases>
+ <snapshots><enabled>true</enabled></snapshots>
+ </repository>
+ <!-- For developing against latest Spring milestones -->
+ <repository>
+ <id>org.springframework.maven.milestone</id>
+ <name>Spring Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ <snapshots><enabled>false</enabled></snapshots>
+ </repository>
+ <!-- For Spring Roo artifacts -->
+ <repository>
+ <id>spring-roo-repository</id>
+ <name>Spring Roo Repository</name>
+ <url>http://spring-roo-repository.springsource.org/release</url>
+ </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>
+ <groupId>org.apache.maven.plugins</groupId>
+ <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>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <!-- Have to use version 1.2 since version 1.3 does not appear to work with ITDs -->
+ <version>1.2</version>
+ <dependencies>
+ <!-- You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${org.aspectj-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjtools</artifactId>
+ <version>${org.aspectj-version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>test-compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outxml>true</outxml>
+ <source>${java-version}</source>
+ <target>${java-version}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <junitArtifactName>junit:junit</junitArtifactName>
+ <excludes>
+ <exclude>**/*_Roo_*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
@@ -0,0 +1,17 @@
+package org.springframework.samples.mvc;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class AjaxUtils {
+
+ public static boolean isAjaxRequest(String requestedWith) {
+ return requestedWith != null ? "XMLHttpRequest".equals(requestedWith) : false;
+ }
+
+ public static boolean isAjaxUploadRequest(HttpServletRequest request) {
+ return request.getParameter("ajaxUpload") != null;
+ }
+
+ private AjaxUtils() {}
+
+}
@@ -0,0 +1,54 @@
+package org.springframework.samples.mvc.convert;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.format.annotation.DateTimeFormat.ISO;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+@Controller
+@RequestMapping("/convert/*")
+public class ConvertController {
+
+ @RequestMapping("primitive")
+ public @ResponseBody String primitive(@RequestParam Integer value) {
+ return "Converted primitive " + value;
+ }
+
+ // requires Joda-Time on the classpath
+ @RequestMapping("date/{value}")
+ public @ResponseBody String date(@PathVariable @DateTimeFormat(iso=ISO.DATE) Date value) {
+ return "Converted date " + value;
+ }
+
+ @RequestMapping("collection")
+ public @ResponseBody String collection(@RequestParam Collection<Integer> values) {
+ return "Converted collection " + values;
+ }
+
+ @RequestMapping("formattedCollection")
+ public @ResponseBody String formattedCollection(@RequestParam @DateTimeFormat(iso=ISO.DATE) Collection<Date> values) {
+ return "Converted formatted collection " + values;
+ }
+
+ @RequestMapping("bean")
+ public @ResponseBody String bean(JavaBean bean) {
+ return "Converted " + bean;
+ }
+
+ @RequestMapping("value")
+ public @ResponseBody String valueObject(@RequestParam SocialSecurityNumber value) {
+ return "Converted value object " + value;
+ }
+
+ @RequestMapping("custom")
+ public @ResponseBody String customConverter(@RequestParam @MaskFormat("###-##-####") String value) {
+ return "Converted '" + value + "' with a custom converter";
+ }
+
+}
@@ -0,0 +1,17 @@
+package org.springframework.samples.mvc.convert;
+
+import org.springframework.format.FormatterRegistry;
+import org.springframework.format.support.FormattingConversionServiceFactoryBean;
+
+public class CustomConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean {
+
+ @Override
+ protected void installFormatters(FormatterRegistry registry) {
+ // register the default formatters in superclass
+ super.installFormatters(registry);
+ // install my custom ones
+ registry.addFormatterForFieldAnnotation(new MaskFormatAnnotationFormatterFactory());
+ }
+
+
+}
Oops, something went wrong.

0 comments on commit 8808447

Please sign in to comment.