Spring——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列二
来源:互联网 发布:php遍历目录 编辑:程序博客网 时间:2024/05/17 09:30
Spring是三大框架SSH中的核心,通过Spring对相应的实例进行对象化,只需要在XML中对相应对象进行配置,就能完成Java对象的实例化和属性的初始化,并能对属性设置值。是整个系统的管理框架,有了Spring的管理,后台代码的编写变得相当容易。
继上次写过 Struts2——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列一后,这次再来介绍一下Spring的相关配置,Spring主要的配置文件为applicationContext.xml,配置如下
<?xml version="1.0" encoding="UTF-8"?><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-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd" ><bean name="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"><property name="configLocation"><value>classpath:hibernate.cfg.xml</value></property></bean><!-- 配置事物管理器 --><bean name="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"><property name="sessionFactory" ref="sessionFactory"/><property name="autodetectDataSource" value="false"/></bean><!-- 配置事物的传播特性 --><tx:advice id="txAdvice" transaction-manager="txManager"><tx:attributes><tx:method name="get*" read-only="true"/><tx:method name="*" propagation="REQUIRED"/></tx:attributes></tx:advice><!-- 配置切入点 --><aop:config><aop:pointcut expression="execution(* net.cxiny.manager.*.*(..))" id="allMgrMethod"/><aop:advisor advice-ref="txAdvice" pointcut-ref="allMgrMethod"/></aop:config></beans>
0 0
- Spring——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列二
- Spring beans——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列三
- Hibernate——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列四
- Hibernate hbm——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列五
- Struts2——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列一
- Hibernate hbm 外键关联——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列六
- SSH(struts+spring+hibernate)框架搭建流程
- 最简单的SSH(Struts+Spring+Hibernate)[二]配置文件
- 用eclipse搭建SSH(struts+spring+hibernate)框架
- SSH框架——整合Demo(Struts、Spring、Hibernate)
- java传统框架ssh---struts、spring、hibernate框架的搭建
- SSH(struts+spring+hibernate)框架
- ssh框架(struts+spring+hibernate)
- SSH(spring+hibernate+struts)框架
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- iOS性能优化小结
- LeetCode: Decode Ways [090]
- OCP 1Z0 051 154
- 将ntfs分区转换为ext4分区
- 1005. 继续(3n+1)猜想 (25)
- Spring——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列二
- 过载保护
- orale 查询每年、每月、每日统计量的sql语句
- N-Queens II
- Redis命令总结
- 多线程访问共享对象和数据的方式
- XCode环境变量及路径设置
- 彻底了解指针数组,数组指针,以及函数指针,以及堆中的分配规则
- oracle 日期函数 求年的最后一天、第一天,月的最后一天