1.<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="ooo" class="com.datangmobile.Obj">
</bean>
<bean id="greeting" class="com.datangmobile.GreetingServiceImpl">
<property name="greeting">
<value>zhangcheng</value>
</property>
<property name="obj">
<ref bean="ooo"/>
</property>
</bean>
<bean id="invoc" class="com.datangmobile.GreetingInvocation"/>
<bean id="knight" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<list>
<!-- 你所需要刺入的类的接口 -->
<value>com.datangmobile.GreetingService</value>
</list>
</property>
<!-- 刺入类 -->
<property name="interceptorNames">
<list>
<value>invoc</value>
</list>
</property>
<!-- 真正接口实现类 -->
<property name="target">
<ref bean="greeting"/>
</property>
</bean>
</beans>
例子描述说明
2.BeanFactory和ApplicationContext
对于ApplicationContext,有三个常用的:ClassPathXmlApplicationContext,FileSystemXmlApplicationContext,XmlWebApplicationContext
3.bean的生命周期
4.bean默认是单例的,尽量依赖init-method和destroy-method.
5.ioc两种方式:通过setter和constructor
6.可以在bean和beanFactory前后加入processor。针对Beanfactory和ApplicationContext下有不同的配置方式
7.
需要重看2.4.4;3.2.4;3.4;5.6.2;6.5
8.需要有空仔细看part3:spring in web tier
8.测试一种情况:当ejb throw runtimeException,应该自动rollback.如果throw checkedException,则需要ctx.setRollBackOnly()才可以回滚
到1.9日,看完第五章,从下周1开始继续看第六章,但需要完成一个例子,用spring+hiberante来处理业务,可以模拟代码示例,eclipse中工程为spring
以上内容截止到2008.1.11
spring in action
Spring框架配置与使用
本文介绍了Spring框架的基本配置方法,包括Bean的定义、生命周期管理、依赖注入方式等,并通过示例展示了如何使用Spring进行业务处理。

被折叠的 条评论
为什么被折叠?



