@Around("execution(* com.jeecms.mybatis.service.MybatisDeviceService.*(..)) ")
public Object around2(ProceedingJoinPoint point) throws Throwable
{
DynamicDataSource.setDataSource("second");
try
{
return point.proceed();
}
finally
{
DynamicDataSource.clearDataSource();
}
}
@Around("execution(* com.jeecms.front.controller.business.TestController*.*(..))")
public Object run1(ProceedingJoinPoint joinPoint) throws Throwable
{
//获取方法参数值数组
Object[] args = joinPoint.getArgs();
//得到其方法签名
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
//获取方法参数类型数组
Class[] paramTypeArray = methodSignature.getParameterTypes();
return null;
}
路径都是对的,但是拦截不到controller
换个思路不就得了 拦截RequestMapping这一类的注解(如果需要单独某些接口,甚至可以自定义注解或者在aop里面自己去筛选这一部分接口)
自定义注解也试过了,拦截不到
把代码打个包丢上来 不可能存在不能拦截的
@Around("execution(* com.jeecms.front.controller.business.TestController.*(..))"),这样应该可以了,貌似是你的类名已经存在了,再用TestController*表示重复了,对比Service的切入点表达式,你看看