Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First commit

  • Loading branch information...
commit 38154bba348cac4e257da40e1d196710dd8f6437 0 parents
Rossen Stoyanchev authored
Showing with 3,222 additions and 0 deletions.
  1. +42 −0 .classpath
  2. +1 −0  .gitignore
  3. +22 −0 .project
  4. +5 −0 .settings/org.eclipse.jdt.core.prefs
  5. +82 −0 .settings/org.eclipse.wst.common.component
  6. +6 −0 .settings/org.eclipse.wst.common.project.facet.core.xml
  7. +188 −0 pom.xml
  8. +37 −0 src/main/java/org/springframework/samples/mvc31/config/ApplicationConfig.java
  9. +120 −0 src/main/java/org/springframework/samples/mvc31/config/WebConfig.java
  10. +22 −0 src/main/java/org/springframework/samples/mvc31/config/security.xml
  11. +56 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/Account.java
  12. +92 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountController.java
  13. +36 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountConverter.java
  14. +31 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountManager.java
  15. +35 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountNotFoundException.java
  16. +75 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/StubAccountManager.java
  17. +18 −0 src/main/java/org/springframework/samples/mvc31/crudcontroller/package-info.java
  18. +41 −0 src/main/java/org/springframework/samples/mvc31/endpointdoc/EndpointDocumentationController.java
  19. +9 −0 src/main/java/org/springframework/samples/mvc31/endpointdoc/package-info.java
  20. +34 −0 src/main/java/org/springframework/samples/mvc31/exceptionhandler/ExceptionController.java
  21. +40 −0 src/main/java/org/springframework/samples/mvc31/exceptionhandler/GlobalExceptionHandler.java
  22. +37 −0 src/main/java/org/springframework/samples/mvc31/exceptionhandler/SimpleException.java
  23. +58 −0 .../java/org/springframework/samples/mvc31/exceptionhandler/mvc/ExtendedExceptionHandlerExceptionResolver.java
  24. +8 −0 src/main/java/org/springframework/samples/mvc31/exceptionhandler/package-info.java
  25. +70 −0 src/main/java/org/springframework/samples/mvc31/handlermethodinterceptor/LoggingHandlerMethodInterceptor.java
  26. +12 −0 src/main/java/org/springframework/samples/mvc31/handlermethodinterceptor/package-info.java
  27. +1 −0  src/main/java/org/springframework/samples/mvc31/handlermethodinterceptor/todo.txt
  28. +40 −0 src/main/java/org/springframework/samples/mvc31/requestcondition/CustomRequestConditionController.java
  29. +49 −0 src/main/java/org/springframework/samples/mvc31/requestcondition/mvc/ExtendedRequestMappingHandlerMapping.java
  30. +39 −0 src/main/java/org/springframework/samples/mvc31/requestcondition/mvc/RoleMapping.java
  31. +68 −0 src/main/java/org/springframework/samples/mvc31/requestcondition/mvc/RolesRequestCondition.java
  32. +10 −0 src/main/java/org/springframework/samples/mvc31/requestcondition/package-info.java
  33. +8 −0 src/main/resources/log4j.properties
  34. +34 −0 src/main/webapp/WEB-INF/views/accounts/edit.jsp
  35. +61 −0 src/main/webapp/WEB-INF/views/accounts/list.jsp
  36. +32 −0 src/main/webapp/WEB-INF/views/accounts/new.jsp
  37. +71 −0 src/main/webapp/WEB-INF/views/endpointdoc.jsp
  38. +34 −0 src/main/webapp/WEB-INF/views/home.jsp
  39. +39 −0 src/main/webapp/WEB-INF/views/login.jsp
  40. +20 −0 src/main/webapp/WEB-INF/views/rolemapping.jsp
  41. +63 −0 src/main/webapp/WEB-INF/web.xml
  42. +36 −0 src/main/webapp/resources/blueprint/ie.css
  43. BIN  src/main/webapp/resources/blueprint/plugins/buttons/icons/cross.png
  44. BIN  src/main/webapp/resources/blueprint/plugins/buttons/icons/key.png
  45. BIN  src/main/webapp/resources/blueprint/plugins/buttons/icons/tick.png
  46. +32 −0 src/main/webapp/resources/blueprint/plugins/buttons/readme.txt
  47. +97 −0 src/main/webapp/resources/blueprint/plugins/buttons/screen.css
  48. +14 −0 src/main/webapp/resources/blueprint/plugins/fancy-type/readme.txt
  49. +71 −0 src/main/webapp/resources/blueprint/plugins/fancy-type/screen.css
  50. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/doc.png
  51. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/email.png
  52. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/external.png
  53. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/feed.png
  54. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/im.png
  55. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/lock.png
  56. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/pdf.png
  57. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/visited.png
  58. BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/xls.png
  59. +18 −0 src/main/webapp/resources/blueprint/plugins/link-icons/readme.txt
  60. +42 −0 src/main/webapp/resources/blueprint/plugins/link-icons/screen.css
  61. +10 −0 src/main/webapp/resources/blueprint/plugins/rtl/readme.txt
  62. +110 −0 src/main/webapp/resources/blueprint/plugins/rtl/screen.css
  63. +29 −0 src/main/webapp/resources/blueprint/print.css
  64. +288 −0 src/main/webapp/resources/blueprint/screen.css
  65. +82 −0 src/main/webapp/resources/blueprint/src/forms.css
  66. +280 −0 src/main/webapp/resources/blueprint/src/grid.css
  67. BIN  src/main/webapp/resources/blueprint/src/grid.png
  68. +79 −0 src/main/webapp/resources/blueprint/src/ie.css
  69. +92 −0 src/main/webapp/resources/blueprint/src/print.css
  70. +65 −0 src/main/webapp/resources/blueprint/src/reset.css
  71. +123 −0 src/main/webapp/resources/blueprint/src/typography.css
  72. +8 −0 src/test/resources/log4j.properties
42 .classpath
@@ -0,0 +1,42 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar" sourcepath="M2_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/home/rossen/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/aspectj/aspectjrt/1.6.8/aspectjrt-1.6.8.jar" sourcepath="M2_REPO/org/aspectj/aspectjrt/1.6.8/aspectjrt-1.6.8-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/aspectj/aspectjweaver/1.6.8/aspectjweaver-1.6.8.jar" sourcepath="M2_REPO/org/aspectj/aspectjweaver/1.6.8/aspectjweaver-1.6.8-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-validator/4.1.0.Final/hibernate-validator-4.1.0.Final.jar" sourcepath="M2_REPO/org/hibernate/hibernate-validator/4.1.0.Final/hibernate-validator-4.1.0.Final-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.8/junit-4.8.jar" sourcepath="M2_REPO/junit/junit/4.8/junit-4.8-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/home/rossen/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aop/3.1.0.BUILD-SNAPSHOT/spring-aop-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-aop/3.1.0.BUILD-SNAPSHOT/spring-aop-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-asm/3.1.0.BUILD-SNAPSHOT/spring-asm-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-asm/3.1.0.BUILD-SNAPSHOT/spring-asm-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/3.1.0.BUILD-SNAPSHOT/spring-beans-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-beans/3.1.0.BUILD-SNAPSHOT/spring-beans-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/3.1.0.BUILD-SNAPSHOT/spring-context-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-context/3.1.0.BUILD-SNAPSHOT/spring-context-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-context-support/3.1.0.BUILD-SNAPSHOT/spring-context-support-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-context-support/3.1.0.BUILD-SNAPSHOT/spring-context-support-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.1.0.BUILD-SNAPSHOT/spring-core-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-core/3.1.0.BUILD-SNAPSHOT/spring-core-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/3.1.0.BUILD-SNAPSHOT/spring-expression-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-expression/3.1.0.BUILD-SNAPSHOT/spring-expression-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/security/spring-security-config/3.0.5.RELEASE/spring-security-config-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/security/spring-security-config/3.0.5.RELEASE/spring-security-config-3.0.5.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/security/spring-security-core/3.0.5.RELEASE/spring-security-core-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/security/spring-security-core/3.0.5.RELEASE/spring-security-core-3.0.5.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/security/spring-security-web/3.0.5.RELEASE/spring-security-web-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/security/spring-security-web/3.0.5.RELEASE/spring-security-web-3.0.5.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-tx/3.0.3.RELEASE/spring-tx-3.0.3.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-tx/3.0.3.RELEASE/spring-tx-3.0.3.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-web/3.1.0.BUILD-SNAPSHOT/spring-web-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-web/3.1.0.BUILD-SNAPSHOT/spring-web-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-webmvc/3.1.0.BUILD-SNAPSHOT/spring-webmvc-3.1.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/spring-webmvc/3.1.0.BUILD-SNAPSHOT/spring-webmvc-3.1.0.BUILD-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
1  .gitignore
@@ -0,0 +1 @@
+target
22 .project
@@ -0,0 +1,22 @@
+<projectDescription>
+ <name>spring-mvc-31-demo</name>
+ <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
5 .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
+#Thu Sep 01 15:42:46 BST 2011
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
82 .settings/org.eclipse.wst.common.component
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="spring-mvc-31-demo">
+ <property name="context-root" value="spring-mvc-31-demo"/>
+ <wb-resource deploy-path="/" source-path="src/main/webapp"/>
+ <property name="java-output-path" value="/target/classes"/>
+ <dependent-module archiveName="aopalliance-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="aspectjrt-1.6.8.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/aspectj/aspectjrt/1.6.8/aspectjrt-1.6.8.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="aspectjweaver-1.6.8.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/aspectj/aspectjweaver/1.6.8/aspectjweaver-1.6.8.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="cglib-nodep-2.2.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="hibernate-validator-4.1.0.Final.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/hibernate/hibernate-validator/4.1.0.Final/hibernate-validator-4.1.0.Final.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="jcl-over-slf4j-1.6.1.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="jstl-1.2.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="log4j-1.2.16.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="slf4j-api-1.6.1.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="slf4j-log4j12-1.6.1.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-aop-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-aop/3.1.0.BUILD-SNAPSHOT/spring-aop-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-asm-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-asm/3.1.0.BUILD-SNAPSHOT/spring-asm-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-beans-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-beans/3.1.0.BUILD-SNAPSHOT/spring-beans-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-context-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-context/3.1.0.BUILD-SNAPSHOT/spring-context-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-context-support-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-context-support/3.1.0.BUILD-SNAPSHOT/spring-context-support-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-core-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-core/3.1.0.BUILD-SNAPSHOT/spring-core-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-expression-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-expression/3.1.0.BUILD-SNAPSHOT/spring-expression-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-security-config-3.0.5.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/security/spring-security-config/3.0.5.RELEASE/spring-security-config-3.0.5.RELEASE.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-security-core-3.0.5.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/security/spring-security-core/3.0.5.RELEASE/spring-security-core-3.0.5.RELEASE.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-security-web-3.0.5.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/security/spring-security-web/3.0.5.RELEASE/spring-security-web-3.0.5.RELEASE.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-tx-3.0.3.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-tx/3.0.3.RELEASE/spring-tx-3.0.3.RELEASE.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-web-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-web/3.1.0.BUILD-SNAPSHOT/spring-web-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-webmvc-3.1.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-webmvc/3.1.0.BUILD-SNAPSHOT/spring-webmvc-3.1.0.BUILD-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="validation-api-1.0.0.GA.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
+ </wb-module>
+</project-modules>
6 .settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,6 @@
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.web" version="2.5"/>
+ <installed facet="jst.java" version="6.0"/>
+</faceted-project>
188 pom.xml
@@ -0,0 +1,188 @@
+<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>spring-mvc-31-demo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Spring MVC 3.1 Demo 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>
+
+ <!-- Spring Security -->
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-config</artifactId>
+ <version>3.0.5.RELEASE</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.security</groupId>
+ <artifactId>spring-security-web</artifactId>
+ <version>3.0.5.RELEASE</version>
+ <exclusions>
+ <!-- Exclude Commons Logging in favor of SLF4j -->
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </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>
+
+ <!-- CGLIB, required for @Configuration usage -->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.2</version>
+ </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> -->
+
+ <!-- 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>
+ </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>
+
37 src/main/java/org/springframework/samples/mvc31/config/ApplicationConfig.java
@@ -0,0 +1,37 @@
+/*
+ * 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.samples.mvc31.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScan.Filter;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.ImportResource;
+import org.springframework.samples.mvc31.crudcontroller.AccountManager;
+import org.springframework.samples.mvc31.crudcontroller.StubAccountManager;
+
+@Configuration
+@ComponentScan(basePackages = "org.springframework.samples.mvc31", excludeFilters = { @Filter(Configuration.class) })
+@ImportResource("classpath:org/springframework/samples/mvc31/config/security.xml")
+public class ApplicationConfig {
+
+ @Bean
+ public AccountManager accountManager() {
+ return new StubAccountManager();
+ }
+
+}
120 src/main/java/org/springframework/samples/mvc31/config/WebConfig.java
@@ -0,0 +1,120 @@
+/*
+ * 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.samples.mvc31.config;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.format.FormatterRegistry;
+import org.springframework.samples.mvc31.crudcontroller.AccountConverter;
+import org.springframework.samples.mvc31.exceptionhandler.GlobalExceptionHandler;
+import org.springframework.samples.mvc31.exceptionhandler.mvc.ExtendedExceptionHandlerExceptionResolver;
+import org.springframework.samples.mvc31.handlermethodinterceptor.LoggingHandlerMethodInterceptor;
+import org.springframework.samples.mvc31.requestcondition.mvc.ExtendedRequestMappingHandlerMapping;
+import org.springframework.web.servlet.HandlerExceptionResolver;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+import org.springframework.web.servlet.view.InternalResourceViewResolver;
+
+/**
+ * Spring MVC Java-based configuration.
+ *
+ * <p>Extends directly from WebMvcConfigurationSupport in order to plug in sub-classes
+ * of Spring MVC infrastructure components like {@code RequestMappingHandlerMapping},
+ * {@code RequestMappingHandlerAdapter}, etc.
+ *
+ * <p>Typically extending from {@link WebMvcConfigurerAdapter} and adding
+ * {@code @EnableWebMvc} is sufficient.
+ *
+ */
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport {
+
+ @Autowired
+ private ApplicationConfig applicationConfig;
+
+ @Override
+ public void addViewControllers(ViewControllerRegistry registry) {
+ registry.addViewController("/").setViewName("home");
+ registry.addViewController("/login").setViewName("login");
+ }
+
+ @Bean
+ public InternalResourceViewResolver viewResolver() {
+ InternalResourceViewResolver resolver = new InternalResourceViewResolver();
+ resolver.setPrefix("/WEB-INF/views/");
+ resolver.setSuffix(".jsp");
+ return resolver;
+ }
+
+ @Override
+ protected void addResourceHandlers(ResourceHandlerRegistry registry) {
+ registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
+ }
+
+ // Configuration for CRUD controller
+ // See ~.crudcontroller
+
+ @Override
+ protected void addFormatters(FormatterRegistry registry) {
+ AccountConverter accountConverter = new AccountConverter(this.applicationConfig.accountManager());
+ registry.addConverter(accountConverter);
+ }
+
+ // Configuration for the interceptor logging HandlerMethod information
+ // See ~.handlermethodinterceptor
+
+ @Override
+ protected void addInterceptors(InterceptorRegistry registry) {
+ registry.addInterceptor(new LoggingHandlerMethodInterceptor());
+ }
+
+ // Configuration for custom @RequestMapping condition
+ // See ~.requestcondition package
+
+ @Override
+ @Bean
+ public RequestMappingHandlerMapping requestMappingHandlerMapping() {
+ RequestMappingHandlerMapping handlerMapping = new ExtendedRequestMappingHandlerMapping();
+ handlerMapping.setOrder(0);
+ handlerMapping.setInterceptors(getInterceptors());
+ return handlerMapping;
+ }
+
+ // Configuration for "global" @ExceptionHandler methods
+ // See ~.exceptionhandler package
+
+ @Override
+ public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
+ exceptionResolvers.add(customExceptionResolver());
+ }
+
+ @Bean
+ public ExceptionHandlerExceptionResolver customExceptionResolver() {
+ ExtendedExceptionHandlerExceptionResolver exceptionResolver = new ExtendedExceptionHandlerExceptionResolver();
+ exceptionResolver.setExceptionHandler(new GlobalExceptionHandler());
+ return exceptionResolver;
+ }
+
+}
22 src/main/java/org/springframework/samples/mvc31/config/security.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:beans="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <http auto-config="true">
+ <form-login login-page="/login"/>
+ <intercept-url pattern="/rolemapping" access="ROLE_USER,ROLE_ADMIN" />
+ </http>
+
+ <authentication-manager>
+ <authentication-provider>
+ <user-service>
+ <user name="user" password="user" authorities="ROLE_USER" />
+ <user name="admin" password="admin" authorities="ROLE_ADMIN" />
+ </user-service>
+ </authentication-provider>
+ </authentication-manager>
+
+</beans:beans>
56 src/main/java/org/springframework/samples/mvc31/crudcontroller/Account.java
@@ -0,0 +1,56 @@
+/*
+ * 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.samples.mvc31.crudcontroller;
+
+import org.hibernate.validator.constraints.NotEmpty;
+
+public class Account {
+
+ private String number;
+
+ @NotEmpty
+ private String name;
+
+ public Account() {
+ }
+
+ public Account(String number, String name) {
+ this.number = number;
+ this.name = name;
+ }
+
+ public String getNumber() {
+ return number;
+ }
+
+ public void setNumber(String number) {
+ this.number = number;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return "[Account number = '" + number + "', name = " + name + "']";
+ }
+
+}
92 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountController.java
@@ -0,0 +1,92 @@
+/*
+ * 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.samples.mvc31.crudcontroller;
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+@RequestMapping("/accounts")
+public class AccountController {
+
+ private AccountManager accountManager;
+
+ @Autowired
+ public AccountController(AccountManager accountManager) {
+ this.accountManager = accountManager;
+ }
+
+ @RequestMapping(method = RequestMethod.GET)
+ public String list(Model model) {
+ model.addAttribute("accounts", this.accountManager.getAccounts());
+ return "accounts/list";
+ }
+
+ @RequestMapping(value="/new", method = RequestMethod.GET)
+ public String newForm(Model model) {
+ model.addAttribute(new Account());
+ return "accounts/new";
+ }
+
+ // The account is loaded from the "account" URI variable via {@link AccountConverter}.
+
+ @RequestMapping(value="/{account}/edit", method = RequestMethod.GET)
+ public String edit(@PathVariable Account account) {
+ return "accounts/edit";
+ }
+
+ // The account is loaded from the "account" URI variable via {@link AccountConverter}.
+ // Data binding and validation are also applied.
+
+ @RequestMapping(value="/{account}", method = RequestMethod.PUT)
+ public String update(@Valid @ModelAttribute Account account, BindingResult result) {
+ if (result.hasErrors()) {
+ return "accounts/edit";
+ }
+ this.accountManager.saveOrUpdate(account);
+ return "redirect:../accounts";
+ }
+
+ // The account is created with its default constructor.
+ // Data binding and validation are also applied.
+
+ @RequestMapping(method = RequestMethod.POST)
+ public String save(@Valid @ModelAttribute Account account, BindingResult result) {
+ if (result.hasErrors()) {
+ return "accounts/edit";
+ }
+ this.accountManager.saveOrUpdate(account);
+ return "redirect:accounts";
+ }
+
+ // The account is loaded from the "account" URI variable via {@link AccountConverter}.
+
+ @RequestMapping(value="/{account}", method = RequestMethod.DELETE)
+ public String delete(@PathVariable Account account, BindingResult result) {
+ this.accountManager.delete(account);
+ return "redirect:../accounts";
+ }
+
+}
36 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountConverter.java
@@ -0,0 +1,36 @@
+/*
+ * 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.samples.mvc31.crudcontroller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.convert.converter.Converter;
+
+public class AccountConverter implements Converter<String, Account> {
+
+ private AccountManager accountManager;
+
+ @Autowired
+ public AccountConverter(AccountManager accountManager) {
+ this.accountManager = accountManager;
+ }
+
+ @Override
+ public Account convert(String source) {
+ return this.accountManager.getAccount(source);
+ }
+
+}
31 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountManager.java
@@ -0,0 +1,31 @@
+/*
+ * 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.samples.mvc31.crudcontroller;
+
+import java.util.List;
+
+public interface AccountManager {
+
+ Account getAccount(String number) throws AccountNotFoundException;
+
+ List<Account> getAccounts();
+
+ void saveOrUpdate(Account account);
+
+ void delete(Account account);
+
+}
35 src/main/java/org/springframework/samples/mvc31/crudcontroller/AccountNotFoundException.java
@@ -0,0 +1,35 @@
+/*
+ * 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.samples.mvc31.crudcontroller;
+
+import org.springframework.core.NestedRuntimeException;
+
+@SuppressWarnings("serial")
+public class AccountNotFoundException extends NestedRuntimeException {
+
+ private final String number;
+
+ public AccountNotFoundException(String number) {
+ super("Account not found: " + number);
+ this.number = number;
+ }
+
+ public String getNumber() {
+ return number;
+ }
+
+}
75 src/main/java/org/springframework/samples/mvc31/crudcontroller/StubAccountManager.java
@@ -0,0 +1,75 @@
+/*
+ * 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.samples.mvc31.crudcontroller;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.springframework.util.StringUtils;
+
+public class StubAccountManager implements AccountManager {
+
+ private final Map<String, Account> accounts;
+
+ private final AtomicInteger nextNumber = new AtomicInteger(3);
+
+ public StubAccountManager() {
+ this.accounts = new HashMap<String, Account>();
+ addAccount("a1", "Jay");
+ addAccount("a2", "Jason");
+ addAccount("a3", "Julie");
+ }
+
+ private void addAccount(String number, String name) {
+ this.accounts.put(number, new Account(number, name));
+ }
+
+ @Override
+ public List<Account> getAccounts() {
+ return new ArrayList<Account>(this.accounts.values());
+ }
+
+ @Override
+ public Account getAccount(String number) {
+ Account account = this.accounts.get(number);
+ if (account == null) {
+ throw new AccountNotFoundException(number);
+ }
+ return account;
+ }
+
+ @Override
+ public void saveOrUpdate(Account account) {
+ if (!StringUtils.hasText(account.getNumber())) {
+ account.setNumber(getNextNumber());
+ }
+ this.accounts.put(account.getNumber(), account);
+ }
+
+ private String getNextNumber() {
+ return "a" + this.nextNumber.incrementAndGet();
+ }
+
+ @Override
+ public void delete(Account account) {
+ this.accounts.remove(account.getNumber());
+ }
+
+}
18 src/main/java/org/springframework/samples/mvc31/crudcontroller/package-info.java
@@ -0,0 +1,18 @@
+
+/**
+ * A controller to list, create, edit, update and delete accounts.
+ * Some operations expect a URI variable (e.g. update, delete) containing the account
+ * number while others don't (e.g. create). Therefore a single @ModelAttribute method
+ * to add the account to the model before all operations won't work.
+ *
+ * <p>This controller shows use of @PathVariable and @ModelAttribute arguments along
+ * with a {@link org.springframework.core.convert.converter.Converter} to load the
+ * Account from its account number.
+ *
+ * <p>For @PathVariable arguments, a URI variable is used to load the Account.
+ * For @ModelAttribute, a URI variable is used if it is available and also data
+ * binding is applied.
+ *
+ */
+package org.springframework.samples.mvc31.crudcontroller;
+
41 src/main/java/org/springframework/samples/mvc31/endpointdoc/EndpointDocumentationController.java
@@ -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.samples.mvc31.endpointdoc;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+
+@Controller
+public class EndpointDocumentationController {
+
+ private final RequestMappingHandlerMapping handlerMapping;
+
+ @Autowired
+ public EndpointDocumentationController(RequestMappingHandlerMapping handlerMapping) {
+ this.handlerMapping = handlerMapping;
+ }
+
+ @RequestMapping(value="/endpointdoc", method=RequestMethod.GET)
+ public void show(Model model) {
+ model.addAttribute("handlerMethods", this.handlerMapping.getHandlerMethods());
+ }
+
+}
9 src/main/java/org/springframework/samples/mvc31/endpointdoc/package-info.java
@@ -0,0 +1,9 @@
+
+/**
+ *
+ * Access and print the details of all controller methods mapped through
+ * {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping}.
+ *
+ */
+package org.springframework.samples.mvc31.endpointdoc;
+
34 src/main/java/org/springframework/samples/mvc31/exceptionhandler/ExceptionController.java
@@ -0,0 +1,34 @@
+/*
+ * 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.samples.mvc31.exceptionhandler;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+public class ExceptionController {
+
+ @RequestMapping("/exception")
+ public void handle() throws Exception {
+
+ throw new SimpleException(
+ "A simulated exception in SimpleController.handle(). " +
+ "The response code should be set to 400 " +
+ "by @ExceptionHandler method in ApplicationExceptionHandler.java.");
+ }
+
+}
40 src/main/java/org/springframework/samples/mvc31/exceptionhandler/GlobalExceptionHandler.java
@@ -0,0 +1,40 @@
+/*
+ * 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.samples.mvc31.exceptionhandler;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.samples.mvc31.exceptionhandler.mvc.ExtendedExceptionHandlerExceptionResolver;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+
+/**
+ * A class with "global" {@code @ExceptionHandler} methods for use across controllers.
+ *
+ * <p>Enabled through {@link ExtendedExceptionHandlerExceptionResolver}.
+ */
+public class GlobalExceptionHandler {
+
+ @ExceptionHandler(value=SimpleException.class)
+ public ResponseEntity<String> handle(SimpleException exception) {
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.TEXT_PLAIN);
+ return new ResponseEntity<String>(exception.getDetail(), headers, HttpStatus.BAD_REQUEST);
+ }
+
+}
37 src/main/java/org/springframework/samples/mvc31/exceptionhandler/SimpleException.java
@@ -0,0 +1,37 @@
+/*
+ * 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.samples.mvc31.exceptionhandler;
+
+@SuppressWarnings("serial")
+public class SimpleException extends Exception {
+
+ private final String detail;
+
+ public SimpleException(String detail) {
+ this.detail = detail;
+ }
+
+ public String getDetail() {
+ return detail;
+ }
+
+ @Override
+ public String toString() {
+ return "SimpleException [detail=" + detail + "]";
+ }
+
+}
58 ...va/org/springframework/samples/mvc31/exceptionhandler/mvc/ExtendedExceptionHandlerExceptionResolver.java
@@ -0,0 +1,58 @@
+/*
+ * 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.samples.mvc31.exceptionhandler.mvc;
+
+import java.lang.reflect.Method;
+
+import org.springframework.samples.mvc31.config.WebConfig;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.method.annotation.ExceptionHandlerMethodResolver;
+import org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver;
+import org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod;
+
+/**
+ * Extends {@link ExceptionHandlerExceptionResolver} to provide "global"
+ * {@code @ExceptionHandler} methods for use across all controllers.
+ *
+ * <p>Plugged in via {@link WebConfig#configureHandlerExceptionResolvers(java.util.List)}.
+ */
+public class ExtendedExceptionHandlerExceptionResolver extends ExceptionHandlerExceptionResolver {
+
+ private Object handler;
+
+ private ExceptionHandlerMethodResolver methodResolver;
+
+ /**
+ * Provide a handler with @{@link ExceptionHandler} methods.
+ */
+ public void setExceptionHandler(Object handler) {
+ this.handler = handler;
+ this.methodResolver = new ExceptionHandlerMethodResolver(handler.getClass());
+ }
+
+ @Override
+ protected ServletInvocableHandlerMethod getExceptionHandlerMethod(HandlerMethod handlerMethod, Exception exception) {
+ ServletInvocableHandlerMethod result = super.getExceptionHandlerMethod(handlerMethod, exception);
+ if (result != null) {
+ return result;
+ }
+ Method method = this.methodResolver.resolveMethod(exception);
+ return (method != null) ? new ServletInvocableHandlerMethod(this.handler, method) : null;
+ }
+
+}
8 src/main/java/org/springframework/samples/mvc31/exceptionhandler/package-info.java
@@ -0,0 +1,8 @@
+
+/**
+ * Demonstrates a way to configure "global" {@code @ExceptionHandler} methods,
+ * i.e. for use across rather than within a controller hierarchy.
+ *
+ */
+package org.springframework.samples.mvc31.exceptionhandler;
+
70 ...ain/java/org/springframework/samples/mvc31/handlermethodinterceptor/LoggingHandlerMethodInterceptor.java
@@ -0,0 +1,70 @@
+/*
+ * 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.samples.mvc31.handlermethodinterceptor;
+
+import java.lang.annotation.Annotation;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
+import org.springframework.core.MethodParameter;
+import org.springframework.core.ParameterNameDiscoverer;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+public class LoggingHandlerMethodInterceptor extends HandlerInterceptorAdapter {
+
+ private static Logger logger = LoggerFactory.getLogger(LoggingHandlerMethodInterceptor.class);
+
+ // TODO
+ private final ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
+
+ @Override
+ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+
+ if (handler instanceof HandlerMethod) {
+ logger.debug(asString((HandlerMethod) handler));
+ }
+
+ return true;
+ }
+
+ private String asString(HandlerMethod handlerMethod) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("\nController:\n").append(handlerMethod.getBeanType().getSimpleName());
+ sb.append("\nMethod:\n");
+ sb.append(handlerMethod.getMethod().getReturnType().getSimpleName()).append(" ");
+ sb.append(handlerMethod.getMethod().getName()).append("(");
+ for (MethodParameter param : handlerMethod.getMethodParameters()) {
+ param.initParameterNameDiscovery(this.parameterNameDiscoverer);
+ for (Annotation annotation : param.getParameterAnnotations()) {
+ sb.append(annotation).append(" ");
+ }
+ sb.append(param.getParameterType().getSimpleName()).append(" ");
+ sb.append(param.getParameterName());
+ if (param.getParameterIndex() < handlerMethod.getMethodParameters().length - 1) {
+ sb.append(" ");
+ }
+ }
+ sb.append(")\n");
+ return sb.toString();
+ }
+
+}
12 src/main/java/org/springframework/samples/mvc31/handlermethodinterceptor/package-info.java
@@ -0,0 +1,12 @@
+
+/**
+ * A {@link org.springframework.web.servlet.HandlerInterceptor} that demonstrates
+ * access to information about the selected controller method.
+ *
+ * <p>Note that HandlerMethod correctly resolves controller and method argument types
+ * and annotations under various conditions -- e.g. when the controller is proxied,
+ * uses generic methods, has annotations in a supertype, etc.
+ *
+ */
+package org.springframework.samples.mvc31.handlermethodinterceptor;
+
1  src/main/java/org/springframework/samples/mvc31/handlermethodinterceptor/todo.txt
@@ -0,0 +1 @@
+https://github.com/SpringSource/spring-data-document-examples/blob/master/mongodb-myrestaurants-analytics/src/main/java/org/springframework/data/document/analytics/MvcEvent.java
40 src/main/java/org/springframework/samples/mvc31/requestcondition/CustomRequestConditionController.java
@@ -0,0 +1,40 @@
+/*
+ * 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.samples.mvc31.requestcondition;
+
+import org.springframework.samples.mvc31.requestcondition.mvc.RoleMapping;
+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 CustomRequestConditionController {
+
+ @RequestMapping(value="/rolemapping", method=RequestMethod.GET)
+ @RoleMapping("ROLE_USER")
+ public void handleForUser(Model model) {
+ model.addAttribute("message", "Content for users with 'ROLE_USER'");
+ }
+
+ @RequestMapping(value="/rolemapping", method=RequestMethod.GET)
+ @RoleMapping("ROLE_ADMIN")
+ public void handleForAdmin(Model model) {
+ model.addAttribute("message", "Content for users with 'ROLE_ADMIN'");
+ }
+
+}
49 ...in/java/org/springframework/samples/mvc31/requestcondition/mvc/ExtendedRequestMappingHandlerMapping.java
@@ -0,0 +1,49 @@
+/*
+ * 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.samples.mvc31.requestcondition.mvc;
+
+import java.lang.reflect.Method;
+
+import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.samples.mvc31.config.WebConfig;
+import org.springframework.web.servlet.mvc.condition.RequestCondition;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+
+/**
+ * Extends RequestMappingHandlerMapping to provide a custom {@link RolesRequestCondition}.
+ *
+ * Plugged in via {@link WebConfig#requestMappingHandlerMapping()}.
+ */
+public class ExtendedRequestMappingHandlerMapping extends RequestMappingHandlerMapping {
+
+ @Override
+ protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) {
+ RoleMapping typeAnnotation = AnnotationUtils.findAnnotation(handlerType, RoleMapping.class);
+ return createCondition(typeAnnotation);
+ }
+
+ @Override
+ protected RequestCondition<?> getCustomMethodCondition(Method method) {
+ RoleMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RoleMapping.class);
+ return createCondition(methodAnnotation);
+ }
+
+ private RequestCondition<?> createCondition(RoleMapping accessMapping) {
+ return (accessMapping != null) ? new RolesRequestCondition(accessMapping.value()) : null;
+ }
+
+}
39 src/main/java/org/springframework/samples/mvc31/requestcondition/mvc/RoleMapping.java
@@ -0,0 +1,39 @@
+/*
+ * 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.samples.mvc31.requestcondition.mvc;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Defines the roles required to map a controller method to a request.
+ *
+ */
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RoleMapping {
+
+ /**
+ * A list of required security roles (e.g. "ROLE_ADMIN").
+ */
+ String[] value() default {};
+
+}
68 src/main/java/org/springframework/samples/mvc31/requestcondition/mvc/RolesRequestCondition.java
@@ -0,0 +1,68 @@
+/*
+ * 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.samples.mvc31.requestcondition.mvc;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.web.servlet.mvc.condition.RequestCondition;
+
+/**
+ * A RequestCondition to match a list of roles to the current user's roles.
+ * Simply delegates to {@link HttpServletRequest#isUserInRole(String)}.
+ */
+public class RolesRequestCondition implements RequestCondition<RolesRequestCondition> {
+
+ private final Set<String> roles;
+
+ public RolesRequestCondition(String... roles) {
+ this(Arrays.asList(roles));
+ }
+
+ private RolesRequestCondition(Collection<String> roles) {
+ this.roles = Collections.unmodifiableSet(new HashSet<String>(roles));
+ }
+
+ @Override
+ public RolesRequestCondition combine(RolesRequestCondition other) {
+ Set<String> allRoles = new LinkedHashSet<String>(this.roles);
+ allRoles.addAll(other.roles);
+ return new RolesRequestCondition(allRoles);
+ }
+
+ @Override
+ public RolesRequestCondition getMatchingCondition(HttpServletRequest request) {
+ for (String role : this.roles) {
+ if (!request.isUserInRole(role)) {
+ return null;
+ }
+ }
+ return this;
+ }
+
+ @Override
+ public int compareTo(RolesRequestCondition other, HttpServletRequest request) {
+ return other.roles.size() - this.roles.size();
+ }
+
+}
10 src/main/java/org/springframework/samples/mvc31/requestcondition/package-info.java
@@ -0,0 +1,10 @@
+
+/**
+ *
+ * Create and configure a "custom"
+ * {@link org.springframework.web.servlet.mvc.condition.RequestCondition}
+ * to map requests to controller methods based on a list of security role.
+ *
+ */
+package org.springframework.samples.mvc31.requestcondition;
+
8 src/main/resources/log4j.properties
@@ -0,0 +1,8 @@
+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
+log4j.category.org.springframework.samples.mvc31=DEBUG
34 src/main/webapp/WEB-INF/views/accounts/edit.jsp
@@ -0,0 +1,34 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
+<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
+<%@ 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>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <h1 class="alt">Edit Account <span class="loud">${account.number}</span></h1>
+ <div class="span-10 last">
+ <spring:url value="/accounts/{number}" var="accountUrl">
+ <spring:param name="number" value="${account.number}" />
+ </spring:url>
+ <form:form modelAttribute="account" action="${accountUrl}" method="PUT">
+ <fieldset>
+ <p>
+ <label for="name">Name: </label><br>
+ <form:input path="name" />
+ <form:errors cssClass="error" path="name" />
+ </p>
+ <button type="submit">Update</button>
+ </fieldset>
+ </form:form>
+ </div>
+ </div>
+</body>
+</html>
61 src/main/webapp/WEB-INF/views/accounts/list.jsp
@@ -0,0 +1,61 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
+<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
+<%@ 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>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <h1 class="alt">Account Listing</h1>
+ <h4>
+ <c:url var="homeUrl" value="/" />
+ <a href="${homeUrl}">Home</a>
+ </h4>
+ <hr>
+ <div class="span-10 last">
+ <table>
+ <thead>
+ <tr>
+ <th>Number</th>
+ <th>Name</th>
+ <th></th>
+ </tr>
+ </thead>
+ <c:forEach var="account" items="${accounts}">
+ <tr>
+ <td>
+ <spring:url var="editUrl" value="/accounts/{number}/edit">
+ <spring:param name="number" value="${account.number}" />
+ </spring:url>
+ <a href="${editUrl}">${account.number}</a>
+ </td>
+ <td>${account.name}</td>
+ <td>
+ <spring:url var="deleteUrl" value="/accounts/{number}">
+ <spring:param name="number" value="${account.number}" />
+ </spring:url>
+ <form:form modelAttribute="account" action="${deleteUrl}" method="DELETE">
+ <button type="submit">Delete</button>
+ </form:form>
+ </td>
+ </tr>
+ </c:forEach>
+ </table>
+ </div>
+ <hr>
+ <div>
+ <p>
+ <c:url var="addUrl" value="/accounts/new" />
+ <h4><a href="${addUrl}">Add</a></h4>
+ </p>
+ </div>
+ </div>
+</body>
+</html>
32 src/main/webapp/WEB-INF/views/accounts/new.jsp
@@ -0,0 +1,32 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
+<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
+<%@ 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>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <h1 class="alt">Edit Account <span class="loud">${account.number}</span></h1>
+ <div class="span-10 last">
+ <c:url value="/accounts" var="newAccountUrl" />
+ <form:form modelAttribute="account" action="${newAccountUrl}" method="POST">
+ <fieldset>
+ <p>
+ <label for="name">Name: </label><br>
+ <form:input path="name" />
+ <form:errors cssClass="error" path="name" />
+ </p>
+ <button type="submit">Add</button>
+ </fieldset>
+ </form:form>
+ </div>
+ </div>
+</body>
+</html>
71 src/main/webapp/WEB-INF/views/endpointdoc.jsp
@@ -0,0 +1,71 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ 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>Spring MVC 3.1 Demo Endpoints</title>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <h1>Spring MVC 3.1 Demo Endpoints</h1>
+ <c:forEach items="${handlerMethods}" var="entry">
+ <div>
+ <hr>
+ <p><strong>${entry.value}</strong></p>
+ </div>
+ <div class="span-3 colborder">
+ <p>
+ <span class="alt">Patterns:</span><br>
+ <c:if test="${not empty entry.key.patternsCondition.patterns}">
+ ${entry.key.patternsCondition.patterns}
+ </c:if>
+ </p>
+ </div>
+ <div class="span-3 colborder">
+ <p>
+ <span class="alt">Request Methods:</span><br>
+ <c:if test="${not empty entry.key.methodsCondition.methods}">
+ ${entry.key.methodsCondition.methods}
+ </c:if>
+ </p>
+ </div>
+ <div class="span-3 colborder">
+ <p>
+ <span class="alt">Headers:</span><br>
+ <c:if test="${not empty entry.key.headersCondition.expressions}">
+ ${entry.key.headersCondition.expressions}
+ </c:if>
+ </p>
+ </div>
+ <div class="span-3 colborder">
+ <p>
+ <span class="alt">Parameters:</span><br>
+ <c:if test="${not empty entry.key.paramsCondition.expressions}">
+ ${entry.key.paramsCondition.expressions}
+ </c:if>
+ </p>
+ </div>
+ <div class="span-3 colborder">
+ <p>
+ <span class="alt">Consumes:</span><br>
+ <c:if test="${not empty entry.key.consumesCondition.expressions}">
+ ${entry.key.consumesCondition.expressions}
+ </c:if>
+ </p>
+ </div>
+ <div class="span-3 last">
+ <p>
+ <span class="alt">Produces:</span><br>
+ <c:if test="${not empty entry.key.producesCondition.expressions}">
+ ${entry.key.producesCondition.expressions}
+ </c:if>
+ </p>
+ </div>
+ </c:forEach>
+ </div>
+</body>
+</html>
34 src/main/webapp/WEB-INF/views/home.jsp
@@ -0,0 +1,34 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ 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>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <h1 class="alt">Spring MVC 3.1 Demo</h1>
+ <hr>
+ <div>
+ <h3 class="alt"><a href="rolemapping">Custom request condition</a><br></h3>
+ <h4>org.springframework.samples.mvc31.mapping.mvc31.requestcondition</h4>
+ </div>
+ <div>
+ <h3 class="alt"><a href="endpointdoc">Endpoint documentation</a></h3>
+ <h4>org.springframework.samples.mvc31.mapping.mvc31.endpointdoc</h4>
+ </div>
+ <div>
+ <h3 class="alt"><a href="accounts">CRUD Controller</a></h3>
+ <h4>org.springframework.samples.mvc31.mapping.mvc31.crud</h4>
+ </div>
+ <div>
+ <h3 class="alt"><a href="exception">Global @ExceptionHandler method</a></h3>
+ <h4>org.springframework.samples.mvc31.mapping.mvc31.exceptionhandler</h4>
+ </div>
+ </div>
+</body>
+</html>
39 src/main/webapp/WEB-INF/views/login.jsp
@@ -0,0 +1,39 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ 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>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <h1>Login</h1>
+ <h3><span class="alt">user/user</span> or <span class="alt">admin/admin</span></h3>
+ <div class="span-10 last">
+ <form name="f" action="/spring-mvc-31-demo/j_spring_security_check" method="POST">
+ <fieldset>
+ <p>
+ <label for="user">User:</label>
+ <br>
+ <input id="user" type="text" name="j_username" value="">
+ </p>
+ <p>
+ <label for="password">Password:</label>
+ <br>
+ <input id="password" type="password" name="j_password" value="">
+ </p>
+ <hr class="space"/>
+ <p>
+ <input name="submit" type="submit"/>
+ <input name="reset" type="reset"/>
+ </p>
+ </fieldset>
+ </form>
+ </div>
+ </div>
+</body>
+</html>
20 src/main/webapp/WEB-INF/views/rolemapping.jsp
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ 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>
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/screen.css" />" type="text/css" media="screen, projection" />
+<link rel="stylesheet" href="<c:url value="/resources/blueprint/print.css" />" type="text/css" media="print" />
+<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection"><![endif]-->
+</head>
+<body>
+ <div class="container">
+ <hr class="space">
+ <h3>${message}</h3>
+ <hr>
+ <h3 class="alt"><a href="j_spring_security_logout" >Log Out</a></h3>
+ </div>
+</body>
+</html>
63 src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <context-param>
+ <param-name>contextClass</param-name>
+ <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>org.springframework.samples.mvc31.config</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>securityFilter</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ <init-param>
+ <param-name>targetBeanName</param-name>
+ <param-value>springSecurityFilterChain</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>securityFilter</filter-name>
+ <servlet-name>appServlet</servlet-name>
+ </filter-mapping>
+
+ <filter>
+ <filter-name>hiddenHttpMethodFilter</filter-name>
+ <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>hiddenHttpMethodFilter</filter-name>
+ <servlet-name>appServlet</servlet-name>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>appServlet</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <init-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value></param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>appServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file></welcome-file>
+ </welcome-file-list>
+
+</web-app>
36 src/main/webapp/resources/blueprint/ie.css
@@ -0,0 +1,36 @@
+/* -----------------------------------------------------------------------
+
+
+ Blueprint CSS Framework 1.0.1
+ http://blueprintcss.org
+
+ * Copyright (c) 2007-Present. See LICENSE for more info.
+ * See README for instructions on how to use Blueprint.
+ * For credits and origins, see AUTHORS.
+ * This is a compressed file. See the sources in the 'src' directory.
+
+----------------------------------------------------------------------- */
+
+/* ie.css */
+body {text-align:center;}
+.container {text-align:left;}
+* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * html .span-15, * html .span-16, * html .span-17, * html .span-18, * html .span-19, * html .span-20, * html .span-21, * html .span-22, * html .span-23, * html .span-24 {display:inline;overflow-x:hidden;}
+* html legend {margin:0px -8px 16px 0;padding:0;}
+sup {vertical-align:text-top;}
+sub {vertical-align:text-bottom;}
+html>body p code {*white-space:normal;}
+hr {margin:-8px auto 11px;}
+img {-ms-interpolation-mode:bicubic;}
+.clearfix, .container {display:inline-block;}
+* html .clearfix, * html .container {height:1%;}
+fieldset {padding-top:0;}
+legend {margin-top:-0.2em;margin-bottom:1em;margin-left:-0.5em;}
+textarea {overflow:auto;}
+label {vertical-align:middle;position:relative;top:-0.25em;}
+input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
+input.text:focus, input.title:focus {border-color:#666;}
+input.text, input.title, textarea, select {margin:0.5em 0;}
+input.checkbox, input.radio {position:relative;top:.25em;}
+form.inline div, form.inline p {vertical-align:middle;}
+form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;}
+button, input.button {position:relative;top:0.25em;}
BIN  src/main/webapp/resources/blueprint/plugins/buttons/icons/cross.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/buttons/icons/key.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/buttons/icons/tick.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 src/main/webapp/resources/blueprint/plugins/buttons/readme.txt
@@ -0,0 +1,32 @@
+Buttons
+
+* Gives you great looking CSS buttons, for both <a> and <button>.
+* Demo: particletree.com/features/rediscovering-the-button-element
+
+
+Credits
+----------------------------------------------------------------
+
+* Created by Kevin Hale [particletree.com]
+* Adapted for Blueprint by Olav Bjorkoy [bjorkoy.com]
+
+
+Usage
+----------------------------------------------------------------
+
+1) Add this plugin to lib/settings.yml.
+ See compress.rb for instructions.
+
+2) Use the following HTML code to place the buttons on your site:
+
+ <button type="submit" class="button positive">
+ <img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
+ </button>
+
+ <a class="button" href="/password/reset/">
+ <img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
+ </a>
+
+ <a href="#" class="button negative">
+ <img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
+ </a>
97 src/main/webapp/resources/blueprint/plugins/buttons/screen.css
@@ -0,0 +1,97 @@
+/* --------------------------------------------------------------
+
+ buttons.css
+ * Gives you some great CSS-only buttons.
+
+ Created by Kevin Hale [particletree.com]
+ * particletree.com/features/rediscovering-the-button-element
+
+ See Readme.txt in this folder for instructions.
+
+-------------------------------------------------------------- */
+
+a.button, button {
+ display:block;
+ float:left;
+ margin: 0.7em 0.5em 0.7em 0;
+ padding:5px 10px 5px 7px; /* Links */
+
+ border:1px solid #dedede;
+ border-top:1px solid #eee;
+ border-left:1px solid #eee;
+
+ background-color:#f5f5f5;
+ font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
+ font-size:100%;
+ line-height:130%;
+ text-decoration:none;
+ font-weight:bold;
+ color:#565656;
+ cursor:pointer;
+}
+button {
+ width:auto;
+ overflow:visible;
+ padding:4px 10px 3px 7px; /* IE6 */
+}
+button[type] {
+ padding:4px 10px 4px 7px; /* Firefox */
+ line-height:17px; /* Safari */
+}
+*:first-child+html button[type] {
+ padding:4px 10px 3px 7px; /* IE7 */
+}
+button img, a.button img{
+ margin:0 3px -3px 0 !important;
+ padding:0;
+ border:none;
+ width:16px;
+ height:16px;
+ float:none;
+}
+
+
+/* Button colors
+-------------------------------------------------------------- */
+
+/* Standard */
+button:hover, a.button:hover{
+ background-color:#dff4ff;
+ border:1px solid #c2e1ef;
+ color:#336699;
+}
+a.button:active{
+ background-color:#6299c5;
+ border:1px solid #6299c5;
+ color:#fff;
+}
+
+/* Positive */
+body .positive {
+ color:#529214;
+}
+a.positive:hover, button.positive:hover {
+ background-color:#E6EFC2;
+ border:1px solid #C6D880;
+ color:#529214;
+}
+a.positive:active {
+ background-color:#529214;
+ border:1px solid #529214;
+ color:#fff;
+}
+
+/* Negative */
+body .negative {
+ color:#d12f19;
+}
+a.negative:hover, button.negative:hover {
+ background-color:#fbe3e4;
+ border:1px solid #fbc2c4;
+ color:#d12f19;
+}
+a.negative:active {
+ background-color:#d12f19;
+ border:1px solid #d12f19;
+ color:#fff;
+}
14 src/main/webapp/resources/blueprint/plugins/fancy-type/readme.txt
@@ -0,0 +1,14 @@
+Fancy Type
+
+* Gives you classes to use if you'd like some
+ extra fancy typography.
+
+Credits and instructions are specified above each class
+in the fancy-type.css file in this directory.
+
+
+Usage
+----------------------------------------------------------------
+
+1) Add this plugin to lib/settings.yml.
+ See compress.rb for instructions.
71 src/main/webapp/resources/blueprint/plugins/fancy-type/screen.css
@@ -0,0 +1,71 @@
+/* --------------------------------------------------------------
+
+ fancy-type.css
+ * Lots of pretty advanced classes for manipulating text.
+
+ See the Readme file in this folder for additional instructions.
+
+-------------------------------------------------------------- */
+
+/* Indentation instead of line shifts for sibling paragraphs. */
+ p + p { text-indent:2em; margin-top:-1.5em; }
+ form p + p { text-indent: 0; } /* Don't want this in forms. */
+
+
+/* For great looking type, use this code instead of asdf:
+ <span class="alt">asdf</span>
+ Best used on prepositions and ampersands. */
+
+.alt {
+ color: #666;
+ font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;
+ font-style: italic;
+ font-weight: normal;
+}
+
+
+/* For great looking quote marks in titles, replace "asdf" with:
+ <span class="dquo">&#8220;</span>asdf&#8221;
+ (That is, when the title starts with a quote mark).
+ (You may have to change this value depending on your font size). */
+
+.dquo { margin-left: -.5em; }
+
+
+/* Reduced size type with incremental leading
+ (http://www.markboulton.co.uk/journal/comments/incremental_leading/)
+
+ This could be used for side notes. For smaller type, you don't necessarily want to
+ follow the 1.5x vertical rhythm -- the line-height is too much.
+
+ Using this class, it reduces your font size and line-height so that for
+ every four lines of normal sized type, there is five lines of the sidenote. eg:
+
+ New type size in em's:
+ 10px (wanted side note size) / 12px (existing base size) = 0.8333 (new type size in ems)
+
+ New line-height value:
+ 12px x 1.5 = 18px (old line-height)
+ 18px x 4 = 72px
+ 72px / 5 = 14.4px (new line height)
+ 14.4px / 10px = 1.44 (new line height in em's) */
+
+p.incr, .incr p {
+ font-size: 10px;
+ line-height: 1.44em;
+ margin-bottom: 1.5em;
+}
+
+
+/* Surround uppercase words and abbreviations with this class.
+ Based on work by Jørgen Arnor Gårdsø Lom [http://twistedintellect.com/] */
+
+.caps {
+ font-variant: small-caps;
+ letter-spacing: 1px;
+ text-transform: lowercase;
+ font-size:1.2em;
+ line-height:1%;
+ font-weight:bold;
+ padding:0 2px;
+}
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/doc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/email.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/external.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/feed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/im.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/lock.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/pdf.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/visited.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  src/main/webapp/resources/blueprint/plugins/link-icons/icons/xls.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 src/main/webapp/resources/blueprint/plugins/link-icons/readme.txt
@@ -0,0 +1,18 @@
+Link Icons
+* Icons for links based on protocol or file type.
+
+This is not supported in IE versions < 7.
+
+
+Credits
+----------------------------------------------------------------
+
+* Marc Morgan
+* Olav Bjorkoy [bjorkoy.com]
+
+
+Usage
+----------------------------------------------------------------
+
+1) Add this line to your HTML:
+ <link rel="stylesheet" href="css/blueprint/plugins/link-icons/screen.css" type="text/css" media="screen, projection">
42 src/main/webapp/resources/blueprint/plugins/link-icons/screen.css
@@ -0,0 +1,42 @@
+/* --------------------------------------------------------------
+
+ link-icons.css
+ * Icons for links based on protocol or file type.
+
+ See the Readme file in this folder for additional instructions.
+
+-------------------------------------------------------------- */
+
+/* Use this class if a link gets an icon when it shouldn't. */
+body a.noicon {
+ background:transparent none !important;
+ padding:0 !important;
+ margin:0 !important;
+}
+
+/* Make sure the icons are not cut */
+a[href^="http:"], a[href^="https:"],
+a[href^="http:"]:visited, a[href^="https:"]:visited,
+a[href^="mailto:"], a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"],
+a[href$=".rss"], a[href$=".rdf"], a[href^="aim:"] {
+ padding:2px 22px 2px 0;
+ margin:-2px 0;
+ background-repeat: no-repeat;
+ background-position: right center;
+}
+
+/* External links */
+a[href^="http:"] { background-image: url(icons/external.png); }
+a[href^="https:"] { background-image: url(icons/lock.png); }
+a[href^="mailto:"] { background-image: url(icons/email.png); }
+a[href^="http:"]:visited { background-image: url(icons/visited.png); }
+
+/* Files */
+a[href$=".pdf"] { background-image: url(icons/pdf.png); }
+a[href$=".doc"] { background-image: url(icons/doc.png); }
+a[href$=".xls"] { background-image: url(icons/xls.png); }
+
+/* Misc */
+a[href$=".rss"],
+a[href$=".rdf"] { background-image: url(icons/feed.png); }
+a[href^="aim:"] { background-image: url(icons/im.png); }
10 src/main/webapp/resources/blueprint/plugins/rtl/readme.txt
@@ -0,0 +1,10 @@
+RTL
+* Mirrors Blueprint, so it can be used with Right-to-Left languages.
+
+By Ran Yaniv Hartstein, ranh.co.il
+
+Usage
+----------------------------------------------------------------
+
+1) Add this line to your HTML:
+ <link rel="stylesheet" href="css/blueprint/plugins/rtl/screen.css" type="text/css" media="screen, projection">
110 src/main/webapp/resources/blueprint/plugins/rtl/screen.css
@@ -0,0 +1,110 @@
+/* --------------------------------------------------------------
+
+ rtl.css
+ * Mirrors Blueprint for left-to-right languages
+
+ By Ran Yaniv Hartstein [ranh.co.il]
+
+-------------------------------------------------------------- */
+
+body .container { direction: rtl; }
+body .column, body .span-1, body .span-2, body .span-3, body .span-4, body .span-5, body .span-6, body .span-7, body .span-8, body .span-9, body .span-10, body .span-11, body .span-12, body .span-13, body .span-14, body .span-15, body .span-16, body .span-17, body .span-18, body .span-19, body .span-20, body .span-21, body .span-22, body .span-23, body .span-24 {
+ float: right;
+ margin-right: 0;
+ margin-left: 10px;
+ text-align:right;
+}
+