- CAspect.java里:
- @Pointcut("execution(* com..action.*Controller.*(..)) && args(request,response)")
- public void pointcutMVC(HttpServletRequest request, HttpServletResponse response){
- }
- @Around("pointcutMVC(request,response)")
- public Object aroundMvc(ProceedingJoinPoint jp,HttpServletRequest request, HttpServletResponse response){
- System.out.println("mvc aop arounding...");
- .. }
- spring配置文件:
- <aop:<SPAN class=hilite1><SPAN class=hilite1>aspectj</SPAN></SPAN>-autoproxy >
- <aop:include name="CAspect"/>
- </aop:<SPAN class=hilite1><SPAN class=hilite1>aspectj</SPAN></SPAN>-autoproxy>
- <bean id="CAspect" class="com.axt.aop.CAspect" />
CAspect.java里:
@Pointcut("execution(* com..action.*Controller.*(..)) && args(request,response)")
public void pointcutMVC(HttpServletRequest request, HttpServletResponse response){
}
@Around("pointcutMVC(request,response)")
public Object aroundMvc(ProceedingJoinPoint jp,HttpServletRequest request, HttpServletResponse response){
System.out.println("mvc aop arounding...");
.. }
spring配置文件:
<aop:aspectj-autoproxy >
<aop:include name="CAspect"/>
</aop:aspectj-autoproxy>
<bean id="CAspect" class="com.axt.aop.CAspect" />
(转)http://www.iteye.com/topic/151658