提交 5f166f67 编写于 作者: J Juergen Hoeller

added warning about annotated controller interfaces (SPR-6655)

上级 56e119e8
/*
* 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
......
/*
* 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
*/
......
......@@ -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">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册