added warning about annotated controller interfaces (SPR-6655)

This commit is contained in:
Juergen Hoeller 2010-02-04 15:52:15 +00:00
parent 56e119e822
commit 5f166f6799
3 changed files with 21 additions and 2 deletions

View File

@ -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 <code>AnnotationMethodHandlerAdapter</code> is defined as well
* - provided that you intend to use <code>@RequestMapping</code>.
*
* <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
* make sure to consistently put <i>all</i> your mapping annotations - such as
* <code>@RequestMapping</code> and <code>@SessionAttributes</code> - on
* the controller <i>interface</i> rather than on the implementation class.
*
* @author Juergen Hoeller
* @author Arjen Poutsma
* @author Sam Brannen

View File

@ -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.
*
* <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
* make sure to consistently put <i>all</i> your mapping annotations - such as
* <code>@RequestMapping</code> and <code>@SessionAttributes</code> - on
* the controller <i>interface</i> rather than on the implementation class.
*
* @author Juergen Hoeller
* @since 2.5
*/

View File

@ -1390,6 +1390,15 @@ public class EditPetForm {
public class EditPetForm {
<lineannotation>// ...</lineannotation>
}</programlisting>
<note>
<para>When using controller interfaces (e.g. for AOP proxying), make sure to
consistently put <emphasis>all</emphasis> your mapping annotations - such as
<interfacename>@RequestMapping</interfacename> and
<interfacename>@SessionAttributes</interfacename> - on the controller
<emphasis>interface</emphasis> rather than on the implementation class.
</para>
</note>
</section>
<section id="mvc-ann-cookievalue">