随笔分类 - Spring
Spring两大特性详解IOC、AOP
摘要:Spring AOP1. 代理模式1.1. 静态代理程序中经常需要为某些动作或事件作下记录,以便在事后检测或作为排错的依据,先看一个简单的例子:import java.util.logging.*;public class HelloSpeaker {private Logger logger = Logger.getLogger(this.getClass().getName());public void hello(String name) {logger.log(Level.INFO, "hello method starts....");System.out.pri
阅读全文
摘要:1. 注入类型a) Spring_0300_IOC_Injection_Typeb) setter(重要)c)构造方法(可以忘记)d)接口注入(可以忘记)以下是setter 注入[html]view plaincopyprint[java]view plaincopyprint?packagecom.demo.service;importorg.junit.Test;importorg.springframework.context.ApplicationContext;importorg.springframework.context.support.ClassPathXmlApplicat
阅读全文

浙公网安备 33010602011771号