- 浏览: 508713 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (299)
- Oracle(pl/sql_Erp_Pro*C) (69)
- 设计模式 (4)
- spring (23)
- ext (17)
- apache开源项目应用 (4)
- jquery (16)
- 生活琐事 (8)
- 下载资源 (23)
- mysql (2)
- Eclipse使用积累 (5)
- 报表类(报表/图表) (13)
- php (4)
- Web多彩文本框 (3)
- json (4)
- jqgrid (2)
- ant (2)
- java算法积累 (8)
- EL表达式/JSTL (4)
- poi (3)
- gwt (2)
- 爬网第一步 (2)
- javascript (17)
- Javaweb (8)
- tomcat (1)
- flex (1)
- Java&DB (3)
- J2SE (7)
- linux (3)
- 数据结构 (1)
- dot net (5)
- struts (1)
- ibatis (1)
- log4j (1)
- 项目管理 (1)
- Java native interface(jni,jacob......) (5)
- applet (1)
- VB.net/C#.net/JNI (20)
- css (1)
- Sqlite (1)
- servlet (1)
- REST (1)
最新评论
-
wenhurena:
能不能给一下解压密码roki.work.2017@gmail. ...
Ebs解体新書と学習資料1 -
liutao1600:
楼主写的太好了,每天学习~~
Spring_MVC(6)测试 -
liutao1600:
太好了,每天学习你的文章~~~
Spring_MVC(3)表单页面处理 -
liutao1600:
学习了,太好了
Spring_MVC(2)控制层处理 -
liutao1600:
学习了~~~
Spring_MVC(1)构建简单web应用
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Application context definition for JPetStore's business layer.
- Contains bean references to the transaction manager and to the DAOs in
- dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation").
-->
<beans xmlns="http://www.springframework.org/schema/beans"
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 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<!-- ========================= GENERAL DEFINITIONS ========================= -->
<!-- Configurer that replaces ${...} placeholders with values from properties files -->
<!-- (in this case, mail and JDBC related properties) -->
<!-- serviceBean -->
<bean id="changingService" class="cn.edu.ysu.spring.service.ChangingService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="contractService" class="cn.edu.ysu.spring.service.ContractService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="projectService" class="cn.edu.ysu.spring.service.ProjectService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="reportService" class="cn.edu.ysu.spring.service.ReportService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="scientistService" class="cn.edu.ysu.spring.service.ScientistService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/kyproject"/>
<property name="username" value="root"/>
<property name="password" value="1234"/>
</bean>
<!-- 管理ibatis的事务,加载sql-map-config.xml文件 -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" >
<value>
classpath:cn\edu\ysu\dao\sqlmap\sql-map-config.xml
</value>
</property>
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"> </property>
</bean>
<!-- daoBean -->
<bean id="changingDAOImpl" class="cn.edu.ysu.dao.daoImplement.ChangingDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="contractDAOImpl" class="cn.edu.ysu.dao.daoImplement.ContractDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="projectDAOImpl" class="cn.edu.ysu.dao.daoImplement.ProjectDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="reportDAOImpl" class="cn.edu.ysu.dao.daoImplement.ReportDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="scientistDAOImpl" class="cn.edu.ysu.dao.daoImplement.ScientistDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<!-- 代理,事务管理器,定义事务 -->
<bean id="daoProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"> </property>
<property name="target">
<list>
<ref local="scientistService"/>
<ref local="changingService"/>
<ref local="contractService"/>
<ref local="projectService"/>
<ref local="reportService"/>
</list>
</property>
<property name="transactionAttributes" >
<props>
<prop key="create*">PROPAGATION_REQUIRED </prop>
<prop key="update*">PROPAGATION_REQUIRED </prop>
<prop key="remove*">PROPAGATION_REQUIRED </prop>
<prop key="to*">PROPAGATION_REQUIRED </prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly </prop>
</props>
</property>
</bean>
<!-- 配置事务特性 -->
<!--
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
-->
<!-- 配置哪些类的方法需要事务 -->
<!--
<aop:config>
<aop:pointcut id="allMethod" expression="execution(* cn.edu.ysu.spring.service.ServiceManagerImpl.getScientistService(..))"/>
<aop:aspect id="other" ref="">
<aop:before pointcut-ref="allMethod" method="other"/>
</aop:aspect>
</aop:config>
-->
<!--
- Application context definition for JPetStore's business layer.
- Contains bean references to the transaction manager and to the DAOs in
- dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation").
-->
<beans xmlns="http://www.springframework.org/schema/beans"
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 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<!-- ========================= GENERAL DEFINITIONS ========================= -->
<!-- Configurer that replaces ${...} placeholders with values from properties files -->
<!-- (in this case, mail and JDBC related properties) -->
<!-- serviceBean -->
<bean id="changingService" class="cn.edu.ysu.spring.service.ChangingService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="contractService" class="cn.edu.ysu.spring.service.ContractService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="projectService" class="cn.edu.ysu.spring.service.ProjectService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="reportService" class="cn.edu.ysu.spring.service.ReportService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<bean id="scientistService" class="cn.edu.ysu.spring.service.ScientistService">
<property name="changingDao" ref="changingDAOImpl"> </property>
<property name="contractDao" ref="contractDAOImpl"> </property>
<property name="reportDao" ref="reportDAOImpl"> </property>
<property name="projectDao" ref="projectDAOImpl"> </property>
<property name="scientistDao" ref="scientistDAOImpl"> </property>
</bean>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/kyproject"/>
<property name="username" value="root"/>
<property name="password" value="1234"/>
</bean>
<!-- 管理ibatis的事务,加载sql-map-config.xml文件 -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" >
<value>
classpath:cn\edu\ysu\dao\sqlmap\sql-map-config.xml
</value>
</property>
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"> </property>
</bean>
<!-- daoBean -->
<bean id="changingDAOImpl" class="cn.edu.ysu.dao.daoImplement.ChangingDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="contractDAOImpl" class="cn.edu.ysu.dao.daoImplement.ContractDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="projectDAOImpl" class="cn.edu.ysu.dao.daoImplement.ProjectDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="reportDAOImpl" class="cn.edu.ysu.dao.daoImplement.ReportDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="scientistDAOImpl" class="cn.edu.ysu.dao.daoImplement.ScientistDAOImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<!-- 代理,事务管理器,定义事务 -->
<bean id="daoProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"> </property>
<property name="target">
<list>
<ref local="scientistService"/>
<ref local="changingService"/>
<ref local="contractService"/>
<ref local="projectService"/>
<ref local="reportService"/>
</list>
</property>
<property name="transactionAttributes" >
<props>
<prop key="create*">PROPAGATION_REQUIRED </prop>
<prop key="update*">PROPAGATION_REQUIRED </prop>
<prop key="remove*">PROPAGATION_REQUIRED </prop>
<prop key="to*">PROPAGATION_REQUIRED </prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly </prop>
</props>
</property>
</bean>
<!-- 配置事务特性 -->
<!--
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
-->
<!-- 配置哪些类的方法需要事务 -->
<!--
<aop:config>
<aop:pointcut id="allMethod" expression="execution(* cn.edu.ysu.spring.service.ServiceManagerImpl.getScientistService(..))"/>
<aop:aspect id="other" ref="">
<aop:before pointcut-ref="allMethod" method="other"/>
</aop:aspect>
</aop:config>
-->
发表评论
-
cronExpression
2010-08-30 17:57 1152一个Cron-表达式是一个由六至七个字段组成由空格分隔的 ... -
spring任务调度(task)
2010-08-23 13:24 2804spring 任务调度总结参考资料http://www.ibm ... -
spring 任务配置
2010-08-23 10:45 1165xml 代码 <bean id="i ... -
spring3.0注解式声明
2010-08-19 17:39 4332从spring2.5开始,annotation结合BeanPo ... -
Spring Roo 自动化集成开发工具
2010-08-04 14:54 2211Roo是一种 Spring 开发的辅助工具,使用命令行操作来生 ... -
spring3.0学习
2010-08-03 16:24 829https://src.springframework.org ... -
Spring mvc 转发、重定向
2010-07-28 16:53 2373spring控制器最后返回一个ModelAndView( ... -
spring api download
2010-07-28 08:43 1138在网上找了好多,都下不下来,要不就是需要注册登录什么的,才能下 ... -
Spring uploadFile
2010-05-02 20:45 2182先让我们来看一段摘自《Spring 2.5 Referen ... -
Spring_MVC(6)测试
2010-04-24 18:48 3677这里将用到以下几个包: 引用 aopalliance-1 ... -
Spring_MVC(5)业务层处理
2010-04-24 18:47 1948这里将用到以下几个包: 引用 aopalliance-1 ... -
Spring_MVC(4)持久层处理
2010-04-24 18:45 1163这里将用到以下几个包: 引用 aopalliance-1 ... -
Spring_MVC(3)表单页面处理
2010-04-24 18:43 3004// 跳转到用户信息页面 ... -
Spring_MVC(2)控制层处理
2010-04-24 18:42 1668言归正传,研究一下注解下的控制层。 我习惯于使用JSTL展示页 ... -
Spring_MVC(1)构建简单web应用
2010-04-24 18:40 1399Java代码 /** * 2010 ... -
spring实现文件上传
2010-04-24 15:15 1577Spring由内置的multipart支持web应用中的文件上 ... -
Spring MVC:使用InternalResourceViewResolver视图解析器
2010-02-24 09:14 2015参考:Sping 2.0.8\docs\MVC-step-by ... -
ibatis+spring控制事务配置
2009-04-05 10:25 1894<bean id="dataSource&qu ... -
转:spring事务控制配置实例
2009-04-03 10:47 3320Spring声明式事务配置的几种方法 在Spring中进 ... -
spring+ibatis+struts配置问题
2009-04-01 14:48 1091以下web.xml配置 <?xml version=&q ...
相关推荐
struts2整合spring、ibatis学生信息管理系统。事务管理、分页处理
NULL 博文链接:https://wilr.iteye.com/blog/1190524
耗时3天,对Struts2+Ibatis+Spring3.0+JreeChart进行了完整整合 包括Spring3.0的事务配置 OSCache二级缓存的配置 log4j实现输出Sql到控制台 JfreeChart与Struts2,Spring3.0的整合 对一个简单的表实现查询,批量删除...
最流行技术Struts2.1 +Spring 2.5.1+ibatis2.3整合开发而成,这与我以前发布的版本中最大特色是整合了Spring2.5.1中的注解功能和半自动化工具ibatis技术,这是本示例的两大特色,简化了配置文件的烦锁,希望能给更多喜欢...
ibatis 完美例子 一对多 批处理 事务 和 spring struts2集成 ,一朵多 插入1万条数据,不到2秒,备注不包含类库
为了开发方便,打算换一个架构,自己整合了s2sibatis框架,采用spring事务管理数据库,喜欢的可以看看,有什么问题请多多指教!
struts hibernate dwr 与Spring完全结合,实现用户列表、信息增、删、改、查、维护时用户重名提示等功能,还包括页面自动转码设置(web.xml),Hibernate管理服务按Bean名称拦截并进行Spring事务管理,完全由Spring...
Struts2 + Spring3 + Mybatis3集成的例子,例子为添加用户和显示所有用户的例子.事务由spring来管理.工程用Maven3来管理 例子中没有jar包,需要自己用maven下载.
【第八章】 对ORM的支持 之 8.3 集成iBATIS ——跟我学spring3 【第八章】 对ORM的支持 之 8.4 集成JPA ——跟我学spring3 【第九章】 Spring的事务 之 9.1 数据库事务概述 ——跟我学spring3 【第九章】 Spring的...
2.5.3 配置iBATIS(预览) 37 2.5.4 构建应用程序 38 2.5.5 运行应用程序 39 2.6 iBATIS未来的发展方向 40 2.6.1 Apache软件基金会 40 2.6.2 更简单、更小且依赖性更少 40 2.6.3 更多的扩展点和插件 41 2.6.4 支持更多...
Struts in Spring 数据持久层 事务管理 持久层封装 JDBC Hibernate in Spring ibatis in Spring Aspect Oriented Programming AOP 概念 AOP in Spring Dynamic Proxy 与Spring AOP CGLib 与 Spring ...
BeanFactory 使用控制反转 (IOC) 模式将应用程序的配置和依赖性规范与实际的应用程序代码分开。 Spring 上下文:Spring 上下文是一个配置文件,向 Spring 框架提供上下文信息。Spring 上下文包括企业服务,例如 ...
16.2 协同使用Spring和WebWork 2/Struts 2 16.3 集成Spring和Tapestry 16.3.1 集成Spring和Tapestry 3 16.3.2 集成Spring和Tapestry 4 16.4 协同使用Spring和JSF 16.4.1 解析JSF管理的属性 16.4.2 解析Spring...
16.2 协同使用Spring和WebWork 2/Struts 2 16.3 集成Spring和Tapestry 16.3.1 集成Spring和Tapestry 3 16.3.2 集成Spring和Tapestry 4 16.4 协同使用Spring和JSF 16.4.1 解析JSF管理的属性 16.4.2 解析Spring...
16.2协同使用spring和webwork2/struts2 16.3集成spring和tapestry 16.3.1集成spring和tapestry3 16.3.2集成spring和tapestry4 16.4协同使用spring和jsf 16.4.1解析jsf管理的属性 16.4.2解析springbean 16.4.3...
4.6 Spring和iBATIS 4.6.1 配置SQL Map 4.6.2 使用SqlMapClientTemplate 4.7 Spring和OJB 4.8 小结 第5章 事务管理 5.1 理解事务 5.1.1 仅用4个词解释事务 5.1.2 理解Spring对...
2.4.1. 在XML里更为简单的声明性事务配置 2.4.2. JPA 2.4.3. 异步的JMS 2.4.4. JDBC 2.5. Web层 2.5.1. Spring MVC的表单标签库 2.5.2. Spring MVC合理的默认值 2.5.3. Portlet 框架 2.6. 其他特性 2.6.1. 动态语言...
Spring 2.0的'spring-jdo.jar', 'spring-jpa.jar', 'spring-hibernate3.jar', 'spring-toplink.jar' 和 'spring-ibatis.jar' 被合并到Spring 2.5大粒度的'spring-orm.jar'中。 Spring 2.5的 'spring-test.jar' 取代...