error at ::0 formal unbound in pointcut
在使用aop的@before进行日志前置通知时,报了这个错误
报错代码在此
@Before(value = "webLogAspect()")
public void logBefore(JoinPoint joinPoint,Object ret) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
//在attribute中加入开始时间
request.setAttribute("time",System.currentTimeMillis());
}
然后我将第二个参数去掉后,正常
@Before(value = "webLogAspect()")
public void logBefore(JoinPoint joinPoint) {
说明多参数的时候,还需要其他的操作,不然会报错
翻译了一下报错,说是切入点中未绑定,于是将参数放入value中
@Before(value = "webLogAspect() && args(ret)")
public void logBefore(JoinPoint joinPoint, Object ret) {
问题解决