を使用して1つのカスタム注釈を作成しました
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping .
すべてのメソッド呼び出しについては、制御が Annotation 実装クラスに移動するため、コストがかかるように見える場合があります。カスタムアノテーションが宣言されているメソッドに対してのみ、コントロールが実装クラスに移動するようにします。どうすればそれを達成できるか教えてください。 私は次のようにそれをしました。
web.xml で:-
<context-param>
 <param-name>contextClass</param-name>
 <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</context-param>
controller.xml で:-
<bean id="myInterceptor" class="com.common.annotation.MyInterceptor"/>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">  
 <property name="interceptors">  
    <list>  
         <ref bean="myInterceptor"/>  
     </list>  
 </property>  
</bean> 
Annotaion クラスで : -
@Target({ElementType.METHOD,ElementType.ANNOTATION_TYPE})  
@Retention(RetentionPolicy.RUNTIME)  
public @interface MyAnnotation {  
        boolean checkAuth() default true;  
    } 
次のように使用します:-
@RequestMapping(value = "/user", method = RequestMethod.GET)
    @MyAnnotation(checkAuth=true)
    public ModelAndView forUser() {........
誰か提案してください。