spring_提示JDK1.5 以及 AOP编程提示error at ::0 can't find referenced pointcut actionMethod

	提示JDK1.5解决办法:

(1)在src目录下新建一个包: org.springframework.core

(2)新建一个类: JdkVersion

(3) 类代码如下:

package org.springframework.core;

public abstract class JdkVersion {
    public static final int JAVA_13 = 0;
    public static final int JAVA_14 = 1;
    public static final int JAVA_15 = 2;
    public static final int JAVA_16 = 3;
    public static final int JAVA_17 = 4;
    //for jre 1.8
    public static final int JAVA_18 = 5;
    private static final String javaVersion = System
            .getProperty("java.version");
    private static final int majorJavaVersion;
    public static String getJavaVersion() {
        return javaVersion;
    }
    public static int getMajorJavaVersion() {
        return majorJavaVersion;
    }
    public static boolean isAtLeastJava14() {
        return true;
    }
    public static boolean isAtLeastJava15() {
        return getMajorJavaVersion() >= 2;
    }
    public static boolean isAtLeastJava16() {
        return getMajorJavaVersion() >= 3;
    }
    static {
        //for jre 1.8
        if (javaVersion.indexOf("1.8.") != -1) {
            majorJavaVersion = 5;
        }else if (javaVersion.indexOf("1.7.") != -1) {
            majorJavaVersion = 4;
        } else if (javaVersion.indexOf("1.6.") != -1) {
            majorJavaVersion = 3;
        } else if (javaVersion.indexOf("1.5.") != -1) {
            majorJavaVersion = 2;
        } else {
            majorJavaVersion = 1;
        }
    }
}



 AOP编程提示error at ::0 can't find referenced pointcut actionMethod, 解决办法:

@Aspect
public class MyInterceptor {

	//@Pointcut("execution(* cn.itcast.service..*.*(..))")
//	@Pointcut("execution (* cn.itcast.service.impl.PersonServiceBean.*(..))")
//	private void anyMethod(){}//声明一个切入点(要拦截的方法)
	
	@Before("execution (* cn.itcast.service.impl.PersonServiceBean.*(..))")//定义前置通知
	public void doAccessCheck(){
		System.out.println("前置通知");
	}
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值