ITeye博客

spring

共 14 篇文章

Spring的配置文件名中的通配符

Spring的配置文件名中的通配符 1、?代表1个字符 2、*代表0个或任意多个字符 3、**代表层级关系

2015-12-22 16:43 · spring

构造函数注入的3种方式【非引用类型】

1、com.tz.model.UserBean.java package com.tz.model; import java.util.Date; /** * 用户信息 * 创建人:LiPiaoShui * 时间:2015年12月7日-下午4:44:15 * @version 1.0.0 */ public class UserBean { private Integer id; private String username; private String password; private Integer age; private String address; private Stri…

2015-12-22 16:18 · spring

set注入的3种方式【非引用类型】

1、com.tz.model.UserBean.java package com.tz.model; import java.util.Date; /** * 用户信息 * 创建人:LiPiaoShui * 时间:2015年12月7日-下午4:44:15 * @version 1.0.0 */ public class UserBean { private Integer id; private String username; private String password; private Integer age; private String address; private Stri…

2015-12-22 15:17 · spring

模拟Spring中扫描注解的代码

模拟Spring中扫描注解的代码 File[] files = new File("D:/code/02-tanzhouedu/tz_springmvc/src/com/tz/dao").listFiles(); for (File file : files) { String filename = StringUtils.cleanPath(file.getAbsolutePath()); String name = filename.replaceAll("D:/code/02-tanzhouedu/tz_springmvc/src/", "").replaceAll("/", ".")…

2015-12-18 15:10 · spring

如何在启动Spring应用程序时对内存等数据进行加载

1、com.tz.util.ApplicationContextUtil.java package com.tz.util; import org.springframework.context.ApplicationContext; /** * ApplicationContext工具类 * 创建人:LiPiaoShui * 时间:2015年12月18日-下午12:39:56 * @verson 1.0.0 */ public class ApplicationContextUtil { private static ApplicationContext appCtx; /** * 初始化…

2015-12-18 15:03 · spring

ApplicationContext接口的继承关系

1、ApplicationContext接口的继承关系图 2、通过ApplicationContext加载配置文件的四种方式 @Test public void testApplicationContext() { //1.通过类路径装载配置文件 //ApplicationContext context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml"); //classpath:applicationContext.xml 等价于 applicationContext.xml Applicatio…

2015-12-18 12:09 · spring

BeanFactory和ApplicationContext的区别

BeanFactory和ApplicationContext的区别 1、ApplicationContext是BeanFactory的子类。 2、BeanFactory在加载完配置文件之后并不会立马初始化对象,而是在调用getBean的时候初始化对象。 3、ApplicationContext在加载完配置文件之后会立马初始化对象,并注册到Map中,它比BeanFactory多了国际化,资源文件的加载以及bean的生命周期管理等等功能。 4、开发中使用的是ApplicationContext,而不会使用BeanFactory。

2015-12-18 11:20 · spring

BeanFactory的结构示意图

1、BeanFactory的结构示意图 2、BeanFactory中子接口的介绍 (1)ListableBeanFactory 该接口定义了访问容器中Bean基础信息的若干方法,查看Bean的个数【getBeanDefinitionCount】,获取Bean的配置名,查看容器是否包含某一个Bean等方法【containsBeanDefinition】。 (2)HierarchicalBeanFactory 父子级联的接口,子容器可以通过接口方法访问父容器。 (3)ConfigurableBeanFactory 核心接口之一,负责Bean的初始化和属性的set和构造函数的注入。 (4)Auto…

2015-12-18 11:14 · spring

Spring提供的资源访问和加载类Resource

1、Spring提供的资源访问和加载类Resource 2、applicationContext.xml中的配置信息 3、测试代码 @Test public void testResource() { // 1.通过ClassPathResource加载配置文件 Resource resource = new ClassPathResource("applicationContext.xml"); XmlBeanFactory xmlBeanFactory = new XmlBeanFactory(resource); UserBean userBean = (UserBean) xmlBe…

2015-12-17 11:02 · spring

Spring中applicationContext.xml文件的初始化过程

Spring中applicationContext.xml文件的初始化过程

2015-12-16 15:40 · spring

项目搭建流程

1、添加jar包 (1)Spring依赖包 spring-aop-4.1.5.RELEASE.jar spring-beans-4.1.5.RELEASE.jar spring-context-4.1.5.RELEASE.jar spring-core-4.1.5.RELEASE.jar spring-expression-4.1.5.RELEASE.jar spring-jdbc-4.1.5.RELEASE.jar spring-tx-4.1.5.RELEASE.jar spring-web-4.1.5.RELEASE.jar spring-webmvc-4.1.5.RELEASE.jar…

2015-12-08 10:35 · spring

Spring的下载地址

地址: http://maven.springframework.org/release/org/springframework/spring/

2015-12-03 15:16 · spring

Spring的体系结构

Spring的体系结构

2015-12-02 13:57 · spring

Spring的特点

Spring的特点 1、方便解耦,简化开发,提升性能(IOC) 2、AOP面向切面编程 3、声明式事务的支持 4、方便程序的调试 5、方便集成各大优秀的框架 6、Java源代码学习的典范

2015-12-02 13:56 · spring