浏览 147 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
最后更新时间:2008-02-20 关键字: schema-based aop
目前正在开发应用了Schema-based AOP的项目,一直用在参考《spring开发参考手册》 在配置AOP的时候发现一些问题:
配置文件如下: <aop:aspect id="prefixAspect3" ref="logInterceptor"> <aop:pointcut id="prefixPointCutQuery" expression="execution(* services.OcsServices.query(Object, int, int)) and args(Object, int, int)" /> <!-- <aop:pointcut id="prefixPointCutQuery" expression="execution(* services.OcsServices.query(Object, int, int)) and args(o, page, perpage)" /> --> <aop:after-returning pointcut-ref="prefixPointCutQuery" returning="retVal" method="afterAddReturn"/> </aop:aspect> </aop:config> services.OcsServices.query方法如下: public List query(Object o, int page, int perpage){ .... } LogAop的afterAddReturn方法如下: public void afterAddReturn(Object retVal){ System.out.println(retVal); } 如果按照参考手册的例子来,expression="execution(* services.OcsServices.query(Object, int, int)) and args(o, page, perpage)"才是正确的配置,但是实际情况是这样配置,将报错aop warning no match for this type name o 而如果用expression="execution(* services.OcsServices.query(Object, int, int)) and args(Object, int, int)"则能正确使用aop, 不知这是什么原因? 还希望大大们能指导指导,谢谢 声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |


