spring
wsow
这个作者很懒,什么都没留下…
展开
-
AOP面向切面编程
AOP:面向切面的编程AOP的底层实现就是通过动态代理来做到的。动态代理 在代理模式基础上发展的,它不在是对单一的类型进行代理,而是可以对任意的一个实现了接口的类的对象做代理。动态代理实现两种方式: 1.通过jdk中提供的Proxy类来实现 这种方式要求,被代理类必须实现接口,即只能为接口做代理. 2.通过cglib来实现,它不要求实现接口。第一种方式的代码转载 2017-07-30 14:05:43 · 149 阅读 · 0 评论 -
基于AspectJ实现AOP
package com.sw.spring.annotation;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target(原创 2017-08-01 01:32:08 · 193 阅读 · 0 评论 -
spring中的spring.xml配置文件的头文件要是3.0.xsd,如果不是在不支持数组值注入
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springfram原创 2017-07-29 00:07:33 · 238 阅读 · 0 评论 -
map集合遍历的两种方式,在spring中的依赖注入
/** * map集合注入 */ @Test public void testBookMAP(){ ApplicationContext ac=new ClassPathXmlApplicationContext("spring.xml"); Book book=ac.getBean("book",原创 2017-07-29 00:24:41 · 565 阅读 · 0 评论