Hi,
i'm using Spring AOP in one of my projects, and the "bean" pointcut expression keyword is exactly what i'm looking for.
I have a slight problem though: i would like to enable the aspect for every method returning a MessageI18N object, defined in a "Service(something)Impl" bean
I tried to define my pointcut that way:
but it didn't work. I also tried withCode:<aop:config> <aop:pointcut id="services" expression="bean(Service*Impl) and execution(MessageI18N *.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="services" /> </aop:config>
but it didn't work either.Code:expression="bean(Service*) and bean(*Impl) and execution(MessageI18N *.*(..))"
I get it to work with:
but i would like to have the pointcut as restrictive as possible, which isn't the case with the previous expression, since i lose the "Service" part of the bean name.Code:expression="bean(*Impl) and execution(MessageI18N *.*(..))"
I'm looking for a tutorial about how wildcards work in pointcut expressions but couldn't find one in Spring reference guide :\
can anyone help me on this one?
Thanks a lot!


Reply With Quote