Spring AOP Generic Typing

aop, java, spring

Solution

Found the solution, a plus sign is needed to indicate a generic.

expression="execution(* com.user.service.DaoJdbc+.*(..))"

Problem

I am new to Spring and I am running into a problem with an aspect. The pointcut is an interface that uses generic typing: ``` public interface DaoJdbc<T> { public void create(T input); public T read(int id); public void update(T s); public void delete(int id); public void getDailyMessage(); } ``` Here is my aspect: ``` <aop:aspect ref="security"> <aop:pointcut id="passwordNeeded" expression="execution(* com.user.service.DaoJdbc.*(..))" /> <aop:before pointcut-ref="passwordNeeded" method="check" /> </aop:aspect> ``` The aspect will work for `delete()`, but not for `create()`. It will work for 'create()' if I use an implementation of DaoJdbc, instead of the interface itself (which I do not want to do). I can assume this is an issue with the fact that `update()` uses a generic type and `delete()` does not. Is there any way I could get this to work using the interface? Thanks in advance.

Original source