
Spring aop可以拦截封装好的jar包里的程序吗?比如jdbc驱动包里的Driver.connect()方法 求救大神!!! 30
1个回答
2015-05-27
展开全部
* Copyright 2007 GuangZhou Cotel Co. Ltd.
* All right reserved.
* 测试异常拦截的bean
* @author <a href="mailto:xiexingxing1121@126.com">AmigoXie</a>
* @version 1.0
* Creation date: 2007-7-24 - 下午08:00:37
*/
public class TestBean {
public void method1() throws Exception {
throw new Exception("Exception happened!");
}
/**
* 将字符串转换为整数.
* @param number 需转换的字符串
* @return 转换成的字符串
* @throws NumberFormatException
* @author <a href="mailto:xiexingxing1121@126.com">AmigoXie</a>
* Creation date: 2007-7-24 - 下午08:05:41
*/
public int changeToNumber(String number) throws NumberFormatException {
//当number为空或非数字时,将抛出NumberFormatException
int num = Integer.parseInt(number);
return num;
}
* All right reserved.
* 测试异常拦截的bean
* @author <a href="mailto:xiexingxing1121@126.com">AmigoXie</a>
* @version 1.0
* Creation date: 2007-7-24 - 下午08:00:37
*/
public class TestBean {
public void method1() throws Exception {
throw new Exception("Exception happened!");
}
/**
* 将字符串转换为整数.
* @param number 需转换的字符串
* @return 转换成的字符串
* @throws NumberFormatException
* @author <a href="mailto:xiexingxing1121@126.com">AmigoXie</a>
* Creation date: 2007-7-24 - 下午08:05:41
*/
public int changeToNumber(String number) throws NumberFormatException {
//当number为空或非数字时,将抛出NumberFormatException
int num = Integer.parseInt(number);
return num;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询