首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

spring容易aop切面示例

2013-04-20 
spring简单aop切面示例spirng简单AOP切面示例配置文件:切面类:测试类:public class TestAop {/** * @param

spring简单aop切面示例
spirng简单AOP切面示例
配置文件:


切面类:

测试类:
public class TestAop {/** * @param args */@SuppressWarnings("deprecation")public static void main(String[] args) {// TODO Auto-generated method stubApplicationContext ac = new FileSystemXmlApplicationContext("src/applicationContext.xml"); IService aService = (IService) ac.getBean("aService"); IService  bService = (IService) ac.getBean("bService");  System.out.println("开始调用aService方法");   aService.foo("hello", 0);  System.out.println("--------------------");  System.out.println("开始调用bService方法");  bService.foo("world", 1); }}

热点排行