spring 2.5 aop做切面的问题

遇到个问题:
    spring 2.5 aop做切面的时候 在 junit 下测试没问题, 到web 下面 相同的方法就切不上了... 有人知道是什么原因么?

配置如下:

<bean id="logInterceptor" class="lzn.aoptest.LogInterceptor"></bean>
<aop:config>
    <aop:pointcut id="aoptest"
    expression="execution(public * cn.ehoo.mre.base.service.impl.*.*(..))" />
<aop:advisor pointcut-ref="aoptest" advice-ref="logInterceptor" />
</aop:config>

 

[code="java"]
依然不行....到jsp 页面 web下访问就是没反映,;, junit 怎么测都好使... [/code]

最后一种可能 你的对象不是从spring 管理容器中取的? :wink:
直接 new 的?

1.0 如果有异常你可以贴一下哦!
2.0 execution(public * cn.ehoo.mre.base.service.impl.*.*(..))
这个范围太小了!所以看下你测试的类是不是这个范围里面!
impl 包下的 类里面的所有方法!

3.0 如果仅为测试 建议写成:
execution(public * cn.ehoo.mre.base.service[color=red]..[/color]*.*(..))

[quote]execution(public * cn.ehoo.mre.base.service..*.*(..)) [/quote]
试试结果咋样?

[code="java"] <!-- spring 集合 aspectj 实现 aop -->
[/code]

这句有没?

把日志级别调低点!
检查下吧 !AOP 我们用到的就那么几个知识点!
可能是你某个细节的问题!
如果是测试项目的话 你就直接发我 邮箱吧!
我帮你搞定! jspp@qq.com

execution(public * cn.ehoo.mre.base.service.impl.*.*(..))
你把这个路劲写 死!
比如 写具体
execution(public * cn.ehoo.mre.base.service.impl.USerImpl.save(..))
然后测试这个方法!

这个应该不是spring的原因吧,你可以测试下看数据能不能到达action这一层。然后再去调试