From 562747ef414b8de4224f3eb9a2ee1b93f12b0cc5 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 15 Sep 2010 08:45:21 +0000 Subject: [PATCH] Review recent documentation and default servlet changes - Relocate and fix typos in interface-based @RequestMapping tip (SPR-7537) - Fix typos in constructor-arg 'name' disambiguation section (SPR-7443) - Polish whitespace in DefaultServletHttpRequestHandler (SPR-7553) --- .../DefaultServletHttpRequestHandler.java | 10 +++--- .../src/beans-dependencies.xml | 4 +-- spring-framework-reference/src/mvc.xml | 31 ++++++++++++------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java index 1cc57521844..1fd85e717d0 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java @@ -51,16 +51,16 @@ public class DefaultServletHttpRequestHandler implements HttpRequestHandler, Ser /** Default Servlet name used by Tomcat, Jetty, JBoss, and GlassFish */ private static final String COMMON_DEFAULT_SERVLET_NAME = "default"; - + /** Default Servlet name used by Google App Engine */ private static final String GAE_DEFAULT_SERVLET_NAME = "_ah_default"; - + /** Default Servlet name used by Resin */ private static final String RESIN_DEFAULT_SERVLET_NAME = "resin-file"; - + /** Default Servlet name used by WebLogic */ private static final String WEBLOGIC_DEFAULT_SERVLET_NAME = "FileServlet"; - + /** Default Servlet name used by WebSphere */ private static final String WEBSPHERE_DEFAULT_SERVLET_NAME = "SimpleFileServlet"; @@ -104,7 +104,7 @@ public class DefaultServletHttpRequestHandler implements HttpRequestHandler, Ser throw new IllegalStateException("Unable to locate the default servlet for serving static content. " + "Please set the 'defaultServletName' property explicitly."); } - } + } } diff --git a/spring-framework-reference/src/beans-dependencies.xml b/spring-framework-reference/src/beans-dependencies.xml index 9156f077c97..bbb9fc04da0 100644 --- a/spring-framework-reference/src/beans-dependencies.xml +++ b/spring-framework-reference/src/beans-dependencies.xml @@ -171,8 +171,8 @@ public class ExampleBean { </bean> Keep in mind that to make this work out of the box your code - has to be compiled with the debug flag enabled so that Spring can - lookup the parameter name from the constructor. If you can't compile + must be compiled with the debug flag enabled so that Spring can + look up the parameter name from the constructor. If you can't compile your code with debug flag (or don't want to) you can use @ConstructorProperties diff --git a/spring-framework-reference/src/mvc.xml b/spring-framework-reference/src/mvc.xml index 4978054b372..6e0a646626b 100644 --- a/spring-framework-reference/src/mvc.xml +++ b/spring-framework-reference/src/mvc.xml @@ -667,18 +667,6 @@ public class HelloWorldController { </beans> - A common pitfall when working with annotated controller classes is - a scenario where you want apply functionality to it that involves - creating a proxy for the controller object (transactional controllers - e.g.). Usually you will introduce an interface for the controller then - to use JDK dynamic proxies. To make this work you have to move the - @RequestMapping annotations to the - interface as well as the mapping lookup only "sees" the interface - exposed by the proxy then. An alternative might be to activate - proxy-target-class="true" in the configuration for the - functionality applied to the controller (in our transaction scenario in - <tx:annotation-driven />). For more information on - various proxying mechanisms see .
@@ -777,6 +765,25 @@ public class ClinicController { } + + Working with interface-based @Controller classes + A common pitfall when working with annotated controller classes + happens when applying functionality that requires creating a proxy + proxy for the controller object (e.g. + @Transactional methods). Usually you + will introduce an interface for the controller in order to use JDK + dynamic proxies. To make this work you must move the + @RequestMapping annotations to the + interface as as the mapping mechanism can only "see" the interface + exposed by the proxy. As an alternative, you may choose to activate + proxy-target-class="true" in the configuration for the + functionality applied to the controller (in our transaction scenario + in <tx:annotation-driven />). Doing so indicates + that CGLIB-based subclass proxies should be used instead of + interface-based JDK proxies. For more information on various proxying + mechanisms see . + +
URI Templates