首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Spring - 施用MethodInterceptor实现AOP

2012-09-16 
Spring -- 使用MethodInterceptor实现AOP.1. 先写出业务对象接口及实现业务对象。 1.public class Main {2.

Spring -- 使用MethodInterceptor实现AOP
.1. 先写出业务对象接口及实现业务对象。





1.public class Main {   2.  3.    /**  4.     *   5.     * @param args  6.     */  7.    public static void main(String[] args) {   8.        ClassPathResource resource = new ClassPathResource("spring.xml");   9.        XmlBeanFactory beanFactory = new XmlBeanFactory(resource);   10.        Interface bean = (Interface)beanFactory.getBean("bean");   11.        bean.hello();   12.           13.        Interface testBean = (Interface)beanFactory.getBean("testBean");   14.        testBean.hello();   15.    }   16.} 


热点排行