hi all,
I'm using org.aopalliance.intercept.MethodInterceptor to intercept some methods and check out if the user has needed privilegies to access it, the problem is that I have other classes with the same method name, but I dont want intercept all classes with the same method name, only a few of them. I have seen the use of ClassFilter but that classes that I dont want intercept the method has tha annotation @Compoment making this classes a Spring controller class.
Is there a way specify only some classes to intercept in the context file?
my context file:
Code:
lt;bean id=quot;interceptorquot; class=quot;package.AccessControllerquot;gt;lt;/beangt;
lt;bean id=quot;controllerClassFilterquot; class=quot;package.ControllerClassFilterquot;gt;lt;/beangt;
lt;bean id=quot;interceptedServicequot; class=quot;org..aop.support.NameMatchMethodPointcutAdvisorquot;gt;
lt;property name=quot;advicequot; ref=quot;interceptorquot;/gt;
lt;property name=quot;mappedNamesquot;gt;
lt;!-- METHOD NAMES THAT WILL BE INTERCEPTED, JUST EXAMPLES --gt;
lt;listgt;
lt;valuegt;examplelt;/valuegt;
lt;valuegt;examplelt;/valuegt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;
thanks in advance!!!!
please, anyone could help!!!!
Hi,
Why don't you try with one of the ways described in '2.4 Method Security' of the reference documentation? |