日期:2014-05-19  浏览次数:20847 次

org.aopalliance.aop.Advice
1.import org.aopalliance.aop.Advice; 
public interface BeforeAdvice extends Advice { 


请问org.aopalliance.aop的源包(包含Advice.java等)哪有下载呀?
*********************************************
*************************************************************
2.package org.springframework.aop;

public interface MethodBeforeAdvice extends BeforeAdvice {

void before(Method(这里提示误说不能解决Method) method,Object[] args, Object target) throws Throwable;

}
以上是两个问题

------解决方案--------------------
o(∩_∩)o... 我和你的问题一样 


import java.lang.reflect.Method;
import org.springframework.aop.MethodBeforeAdvice;


public class LogAdvice implements MethodBeforeAdvice {


public void before(Method m, Object[] args, Object target)
throws Throwable {
System.out.println("invode......>"+m.getName());

}

}
是不是导了spring相关的包但eclipse提示有The project was not built since its build path is incomplete. Cannot find the class file for org.aopalliance.aop.Advice. Fix the build path then try building this project等着我解决了告诉你……谁让我来到这里来了(百度啊)
The type org.aopalliance.aop.Advice cannot be resolved. It is indirectly referenced from required .class files 先提交再说解决问题了在我楼下发贴你楼上不要倒水啊……
------解决方案--------------------
楼下是我……
是你要的文件:aopalliance-1.0.jar 这里有
http://mirrors.ibiblio.org/pub/mirrors/maven2/aopalliance/aopalliance/1.0/
嗨!嗨!可以冲凉睡觉了 问题算是告一小段路了

------解决方案--------------------
哦 !同时推荐你看看这几个网址都是讲解SPRING AOP 
http://blog.ccidnet.com/blog-htm-do-showone-uid-38235-itemid-96644-type-blog.html
我拷贝一部分你先瞧瞧在决定……o(∩_∩)o...
. Spring中通知类型
Spring提供几种现成的通知类型并可扩展提供任意的通知类型。让我们看看基本概念和 标准的通知类型。

5.3.2.1. Interception around advice
Spring中最基本的通知类型是interception around advice .

Spring使用方法拦截器的around通知是和AOP联盟接口兼容的。实现around通知的 类需要实现接口MethodInterceptor:

public interface MethodInterceptor extends Interceptor {
  
Object invoke(MethodInvocation invocation) throws Throwable;
}