问题是:输出业务类:" target.getClass().getName().toString() “结果为什么不是包名和类”com.crm.yuanj.serve.biz.SerivceBIZImpl“而是”$Proxy1“呢?
源代码:
public void afterReturning(Object returnValue, Method method,
Object[] params, Object target) throws Throwable { DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String date = df.format(new Date());
String message = "[业务日志]\n 时间:" + date + "\n 业务类:"
+ target.getClass().getName().toString() + "\n 业务方法:" + method.getName()
+ "\n 参数:" + Arrays.toString(params) + "\n 返回值:" + returnValue;
System.out.println(message);
logBiz.save(returnValue,method,params,target);
}输出结果:
[业务日志]
时间:2008-12-04 01:35:10
业务类:$Proxy1
业务方法:pageSeacherCust
参数:[com.crm.entity.TblCust@104eeb6, com.crm.entity.Page@d42fe0]
返回值:[com.crm.entity.TblCust@f39ae5, com.crm.entity.TblCust@13e4a85, com.crm.entity.TblCust@8e6dae, com.crm.entity.TblCust@c2f95e, com.crm.entity.TblCust@819912]
源代码:
public void afterReturning(Object returnValue, Method method,
Object[] params, Object target) throws Throwable { DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String date = df.format(new Date());
String message = "[业务日志]\n 时间:" + date + "\n 业务类:"
+ target.getClass().getName().toString() + "\n 业务方法:" + method.getName()
+ "\n 参数:" + Arrays.toString(params) + "\n 返回值:" + returnValue;
System.out.println(message);
logBiz.save(returnValue,method,params,target);
}输出结果:
[业务日志]
时间:2008-12-04 01:35:10
业务类:$Proxy1
业务方法:pageSeacherCust
参数:[com.crm.entity.TblCust@104eeb6, com.crm.entity.Page@d42fe0]
返回值:[com.crm.entity.TblCust@f39ae5, com.crm.entity.TblCust@13e4a85, com.crm.entity.TblCust@8e6dae, com.crm.entity.TblCust@c2f95e, com.crm.entity.TblCust@819912]
如果我又要用aop又要有com.crm.yuanj.serve.biz.SerivceBIZImpl打印那怎么办呢