
Spring Framework
文章平均质量分 72
wxhawk
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Spring v3.0.2 Learning Note 1 - Introduction to Spring Framework
官网地址 http://www.springsource.org/控制反转 Inversion of Control public class PersonManager { IPersonDao personDao = new PersonDao(); public void save(Person person) { personDao.save原创 2010-10-25 10:59:00 · 406 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 11 - XML-based Transaction Management
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans ht原创 2010-10-25 11:14:00 · 391 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 12 - Integrate with Hiberate
与hibernate的集成环境Spring v3.0.2Hibernate V3.3.1 MySql v5.0.22JDK 1.6.x数据库脚本: drop database if exists `springlearn`; create database `springlearn`; use `springlearn`; create table `springlearn`.`spring_seq_no` ( seq_no int(20) not null primary key,原创 2010-10-25 11:15:00 · 1260 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 13 - AOP Example
命名空间的支持 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/bean原创 2010-10-25 11:15:00 · 789 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 15 - Use Velocity Email Template with Spring
go on with Learning Note 14 - Send Email With SpringReference Library need add the following reference library files for velocity %SPRING_DEP%/org.apache.commons/com.springsource.org.apache.commons.collections/3.2.1/com.springsource.org.apache.commons.co原创 2010-10-25 11:17:00 · 1015 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 16 - Integrate With Hessian
Reference Library %SPRING%/dist/com.springsource.org.aopalliance-1.0.0.jar%SPRING%/dist/org.springframework.aop-3.0.2.RELEASE.jar %SPRING%/dist/org.springframework.asm-3.0.4.RELEASE.jar %SPRING%/dist/org.springframework.beans-3.0.2.RELEASE.jar %SPRING%原创 2010-10-25 13:28:00 · 1231 阅读 · 0 评论 -
Logging and Spring AOP
Problem Normally, we log down the values of parameters of a method and the value of return of a method. For example, public class MyClass { public YYY getSomething(int id, Object obj) { log.debug ("para[id]="+id+",para[obj]="+obj);原创 2010-10-27 16:42:00 · 754 阅读 · 0 评论 -
CRUD data in LDAP with spring v3.x
Environment:JDK 1.6.x Oralce Identity Directory 11g Spring 3.x --add the following ldap-related jar files in spring to your project spring-ldap-core-tiger-1.3.0.RELEASE.jar spring-ldap-1.3.0.RELEASE-all.jar commons-lang-1.6.2.jar commons-logging-1.0原创 2010-11-15 14:53:00 · 560 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 14 - Send Email with Spring
Reference Library %SPRING%/dist/org.springframework.core-3.0.2.RELEASE.jar %SPRING%/dist/org.springframework.asm-3.0.2.RELEASE.jar %SPRING%/原创 2010-10-25 11:16:00 · 921 阅读 · 0 评论 -
troubleshooting procedure for Spring + Hessian
1) How to get HttpServletRequest object so as to call getRemoteAddr()There is a request from client to restrict a limit of machines' IPs to原创 2010-11-15 16:14:00 · 815 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 10 - Annotation-based Transaction Management
基于注解的事务管理配置数据源: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/be原创 2010-10-25 11:14:00 · 443 阅读 · 0 评论 -
解惑 spring 嵌套事务
转自http://www.javaeye.com/topic/35907 /** * @author 王政 * @date 2006-11-24 * @note 转载请注明出处 */ 在所有使用 spring 的应用中, 声明式事务管理可能是使用率最高的功能了, 但是, 从我观察到的情况看, 绝大多数人并不能深刻理解事务声明中不同事务传播属性配置的的含义, 让我们来看一下 TransactionDefinition 接口中的定义 。Java代码 /**转载 2010-10-25 11:13:00 · 303 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 2 - A Sample Example
准备Spring v3的发布包与之前的版本有了很大的不同,先下载spring-framework-3.0.2.RELEASE.zip和spring- framework-3.0.2.RELEASE-dependencies.zip,并解压至本地硬盘,解压后的目录标示为%SPRING% 和%SPRING_DEP%在eclipse中创建一个java项目在eclipse的'Configure Build Path...'选项中将以下依赖包配置在classpath下 %SPRING%原创 2010-10-25 11:06:00 · 483 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 3 - Initialisation of Beans
使用类的构造器实例化使用静态工厂的方法实例化假设有一个工厂类返回类的实例。 package com.spring.test.manager.impl; public class PersonManagerFactory { // 静态工厂方法创建类的实例 public static PersonManager createPersonManager() { return new PersonManager(); } } 这种情况下该如何配置sprin原创 2010-10-25 11:06:00 · 376 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 4 - Scope of Beans
Scope of Spring Beanssingleton在每个Spring IOC容器中一个Bean有且仅有一个对象实例。 默认情况下,在容器启动时初始化Bean。可以指定bean节点的lazy-init="true"来延迟初始化bean,此时只有在第一次获取Bean才会初始化bean。 如: 如果想对所有Bean都应用延迟初始化,可以在根节点beans设置default-lazy-init="true",如:prototype每次从容器获取的bean都是新的对象。requestsessiongl原创 2010-10-25 11:07:00 · 420 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 5 - Lifecycle of Beans
指定Bean的初始化和销毁scope="singleton"的bean在容器启动时,同时进行初始化验证一下这个结论,在构造函数中输出一句话,假设该类为: package com.spring.test.manager.impl; import com.spring.test.manager.IPersonService; public class PersonManager implements IPersonService { public PersonManager() {原创 2010-10-25 11:07:00 · 442 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 6 - Inject Components
注入依赖对象基本类型对象注入: //构造器注入 // 属性setter方式注入Ref使用内部bean ,但该bea原创 2010-10-25 11:09:00 · 371 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 7 - Constructor-based dependency injection
基于构造器的注入方式 package com.spring.test.dao; public class PersonDao { public void add() { System.out.println("This is add() method in DAO layer."); } } -------------------------------------------------------------------------- package co原创 2010-10-25 11:10:00 · 339 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 8 - Annotation-based dependency injection
Annotation注解的注入方式准备工作 1) 引入依赖包 将下列依赖包加入项目的classpath中: %SPRING_DEP%/javax.annotation/com.springsource.javax.annotation/1.0.0/com.springsource.javax.annotation-1.0.0.jar %SPRING_DEP%的路径参考http://wangxiangblog.blogspot.com/2010/10/spring-v302-learning-not原创 2010-10-25 11:10:00 · 380 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 9 - Classpath Scanning
在classpath自动扫描将组件纳入容器管理 前面的例子都是使用xml的bean定义来配置组件,即便使用了@Resource或者@Autowired的方式减少了一部分bean的定义,但是在一个稍大的项目中,通常还是会有几十甚至数百个组件,查找或维护都不太方便。 自从Spring v2.5以后,引入了组件自动扫描的机制,它可以在类路径下寻找标注了@Component、@Service、@Controller、 @Repository注解的类,并将这些类纳入spring容器进行管理。它的作用和在xm原创 2010-10-25 11:11:00 · 453 阅读 · 0 评论 -
详解Spring事务属性
转自 http://www.javaeye.com/topic/78674 Spring声明式事务让我们从复杂的事务处理中得到解脱。使得我们再也无需要去处理获得连接、关闭连接、事务提交和回滚等这些操作。再也无需要我们在与事务相关的方法中处理大量的try…catch…finally代码。 我们在使用Spring声明式事务时,有一个非常重要的概念就是事务属性。事务属性通常由事务的传播行为,事务的隔离级别,事务的超时值和事务只读标志组成。我们在进行事务划分时,需要进行事务定义,也就是配置事务的属性。 S转载 2010-10-25 11:12:00 · 290 阅读 · 0 评论 -
Spring v3.0.2 Learning Note 16 (Cont.)- Resolve NullPointerException on weblogic v10.3
In this article http://wangxiangblog.blogspot.com/2010/10/spring-v302-learning-note-16-integrate.html, I mentioned that NullPointerException原创 2010-11-15 15:26:00 · 877 阅读 · 0 评论