bind Spring HandlerInterceptor only to one controller

Viewed 15134

Using Spring 3.0.2.RELEASE. I'm having 2 Controllers in package com.myCompany. The Controllers are activated via Component-scan

<context:component-scan base-package="com.myCompany" />

then I'm having a interceptor bind to the 2 controllers via

<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
   <property name="interceptors">
     <list>
       <ref bean="myInterceptor"/>
     </list>
   </property>
 </bean>

How can i bind the interceptor to only one specific Controller or to only certain methods inside a Controller? Background: I want to inspect the URL that it contains certain parameters

Docu Link

1 Answers
Related