diff --git a/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java b/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java index e63d72988f7b42a91ff776877b03873d2a807a9f..7e001314dcbde834df684e6da1e4b3f1762a51b1 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java +++ b/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 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. @@ -168,6 +168,11 @@ import java.lang.annotation.Target; * and/or AnnotationMethodHandlerAdapter is defined as well * - provided that you intend to use @RequestMapping. * + *

NOTE: When using controller interfaces (e.g. for AOP proxying), + * make sure to consistently put all your mapping annotations - such as + * @RequestMapping and @SessionAttributes - on + * the controller interface rather than on the implementation class. + * * @author Juergen Hoeller * @author Arjen Poutsma * @author Sam Brannen diff --git a/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java b/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java index 076bec779be91d5addfd85da4598b6c452914a23..ec9138f0ac1e6649659d75f7614468d27dd130a2 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java +++ b/org.springframework.web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -43,6 +43,11 @@ import java.lang.annotation.Target; * Alternatively, consider using the attribute management capabilities of the * generic {@link org.springframework.web.context.request.WebRequest} interface. * + *

NOTE: When using controller interfaces (e.g. for AOP proxying), + * make sure to consistently put all your mapping annotations - such as + * @RequestMapping and @SessionAttributes - on + * the controller interface rather than on the implementation class. + * * @author Juergen Hoeller * @since 2.5 */ diff --git a/spring-framework-reference/src/mvc.xml b/spring-framework-reference/src/mvc.xml index e19e3b560681b4ca1ad0c512b156db6f8f492cbc..72fc1e14393ffb30f1840e120fd13a6ba93f8a2b 100644 --- a/spring-framework-reference/src/mvc.xml +++ b/spring-framework-reference/src/mvc.xml @@ -1390,6 +1390,15 @@ public class EditPetForm { public class EditPetForm { // ... } + + + When using controller interfaces (e.g. for AOP proxying), make sure to + consistently put all your mapping annotations - such as + @RequestMapping and + @SessionAttributes - on the controller + interface rather than on the implementation class. + +