Spring
共 5 篇文章
从HelloWorld到Spring
学程序大多是从HelloWorld开始 . 自己也是通过参考书看了这个例子 加上自己的一点体会. 来理解Spring 的核心 在Hello World的例子中我们有两个角色 1, 消息提供者 ,2,消息显示者. 通过分离她们的职责我们来理解Spring的 DI temp.properties displayer = ConcreteMessageDisplayer supplier = HelloWorldMessageSupplier MessageSupplier.java public interface MessageSupplier{ //取得消息 String getMessag…
2010-03-05 11:06 · Spring · Java · Spring · Blog · .net · 设计模式
Spring核心Bean工厂装配__Spring学习笔记
在Spring 中最核心的组件是bean工厂,它提供了基本的反向控制和依赖注入的能力。Spring 是一种无侵入性的框架,被bean工厂管理的组件无须知道spring的存在。bean工厂负责打造bean,并注射它们之间的依赖。这些bean会彼此协作。 spring中最基本的BeanFactory接口org.springframework.beans.factory.BeanFactory ,它提供一些工厂的基本方法。 package org.springframework.beans.factory; import org.springframework.beans.BeansFaExcep…
2010-03-05 11:04 · Spring · Spring · Eclipse · XML · 配置管理 · Bean
Sping中自定义属性编辑器
Spring通过PropertyEdit(属性编辑器) 可以将字符串转换为真实类型。通过CustomEditorConfigurer ,ApplicationContext 可以很方便的支持自定义 PropertyEdit。 MyType.java package com.cao.spring.applicationContext; public class MyType { private String text; public MyType(String text){ this.text = text; } public String getText(){ return this.tex…
2010-03-05 10:55 · Spring · Spring · Blog · .net · XML · Bean
WEB中加载ApplicationContext的两种方式
1,通过Listener加载ApplicationContext <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> -----------------…
2010-03-05 10:54 · Spring · Blog · .net · XML · Web · Servlet
Spring 和struts 整合的三种方式
Spring 和 struts 整合的三种方式。 1,使用Spring 的 ActionSupport 2, 使用Spring 的 DelegatingRequestProcessor 类。 3,全权委托。 无论用那种方法来整合第一步就是要为struts来装载spring的应用环境。 就是在 struts 中加入一个插件。 struts-config.xml中 <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocatio…
2010-03-05 10:52 · Spring · DAO · Spring · Struts · Web · Bean