Hi all,
I am newbie to AOP, and i want to have around advice for methods in controller. My interceptor method is not invoked for controllers, however, it works for other packages. Please let me know if I am doing something wrong.
This is my controller:
Code:@Controller public class HomeController { @RequestMapping("/home.htm") public String redirect(HttpServletRequest request) { return "home"; } }And configuration as:Code:@Aspect public class LoggingInterceptor { @Around("execution(* com.somepack.controller..*.*(..))") public Object invokeMethod(ProceedingJoinPoint pjp) throws Throwable { ... o = pjp.proceed(); ... return o; } }
Interceptor method is not invoked for "redirect" method of controller.Code:<bean id=" loggingInterceptor" class="com.somepack.util.LoggingInterceptor" /> <aop:aspectj-autoproxy> <aop:include name="loggingInterceptor" /> </aop:aspectj-autoproxy>
Please let me know if I am doing something wrong.


Reply With Quote
