大家互相学习,有什么不妥的地方希望指正
<?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:p="http://www.springframework.org/schema/p"
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.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<!-- 配置事务特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="*" read-only="false"/>
</tx:attributes>
</tx:advice>
<!-- 声明哪些包使用事务 -->
<aop:config >
<aop:pointcut expression="execution(* com.acca.service.*.*(..))" id="serviceManager"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceManager"/>
</aop:config>
</beans>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/hibernate?useUnicode=true&characterEncoding=UTF8
</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">mysql</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>//表示数据库中如果没有对应的表舅创建,如果存在则更新
<mapping resource="com/acca/domain/User.hbm.xml" />//表示要引入的实体配置文件
<mapping resource="com/acca/domain/Role.hbm.xml" />
<mapping resource="com/acca/domain/UserRole.hbm.xml" />
<mapping resource="com/acca/domain/Permission.hbm.xml" />
<mapping resource="com/acca/domain/Acl.hbm.xml" />
</session-factory>
</hibernate-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>log4j</param-name>
<param-value>classpath:WEB-INF/classes/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
分享到:
相关推荐
Struts2.3 + Spring3.2 + Hibernate4.1 + HTML5 + CSS3开发示例代码。 其中包括如下文件: 介绍文档 Struts2.3 + Spring3.2 + Hibernate4.1 + HTML5 + CSS3开发示例.docx Eclipse工程文件 SSH2.zip Zip包是Eclipse...
本框架为struts2+spring3+hibernate4+urlrewrite(伪静态地址) Struts采用通配,web-inf下的urlrewrite.xml为伪静态配置文件,跳转到struts.xml进行对应
Struts2.3 + Spring4.2 +Hibernate3.6 的全部jar包整合,共有28个。 导入jar 之后、再导入相对应的配置文件 即可进行开发!
1.使用struts2+spring3+hibernate3整合实现用户CRUD功能。 2.使用多种配置方式 A.将hibernate从外部导入,使用MySQL作为数据库。 B.将hibernate实体映射集成到spring配置文件中。 3.使用传统的配置文件集成...
配置 ssh2连接的详细解说,struts2+hibernate+spring整合的框架步骤及简单的知识,具体实现可以联系我
12.6.1 Struts、Spring和Hibernate的整合方式 12.6.2 编写用户注册画面regedit.jsp 12.6.3 编写用户登录画面login.jsp 12.6.4 编写注册控制器RegeditAction.java 12.6.5 编写登录控制器LoginAction.java 12.6.6 建立...
采用在web.xml中加载spring配置文件的方法降低struts和spring的耦合度,使用自定义的MyDelegatingRequestProcessor类来代替spring的DelegatingRequestProcessor类来解决spring中action的bean的重复配置问题。...
1、struts1.2+spring 2.0+...2、struts的动作交由spring来管理,hibernate的配置集中在spring中配置。 3、增加了声明式事务处理,加强了hibernateTemplate的简单事务处理。 4、完整的Myeclipse的工程文件,测试可用!
struts-2.3.1+spring3.1.1+hibernate3.6.9整合&配置文件 jar包
本版本全面更新了jar包,全部使用了当前最新版本的jar包,struct2.1.8 spring3 hibernate3.5,全面使用注解取代xm的l配置。 另外增加了一个ant构建脚本,支持使用hudson完成每日构建,持续集成,自动测试,代码规范...
struts2.2.3+spring3.0.3+hibernate3.6.7整合jar包 +配置文件+整合Struts2.2与Hibernate3.6需要的Spring3.1相关JAR文件.doc+SSM config.xml.doc+mybatis-spring-1.0.0-reference-simplified-chinese.pdf
SSH框架整合struts2.3.4+spring3.1.3+Hibernate4.1.4 数据库采用sql2008 包含配置文件级jar包图
自己搭建的关于struts1+spring3+hibernate4+log4j整合的一个用户注册的项目,里面包含所有的引用jar包,导入就可以用,供大家参考. 这里比之前传的文件多了一个log4j的配置,里面包括多种方式的日志管理
本次文件包括struct配置文件,spring配置文件,hibernate配置文件。均为最新版本配置,绝对能用。本附件将hibernate的配置文件,融入spring文件中,并且将action和bean配置分开管理,更易理解。欢迎下载!
这里是使用spring配置文件管理hibernate。 先配置mysql数据驱动,打开eclipse database explorer perspective,选择tie数据库中的user表,创建hibernate Reverse Engineering 生成vo,还可以生成dao。 5. 这样...
struts2.3.8+spring3.2.1+hibernate4.2 集成环境,里面包含jar包及配置文件。是一个干净的环境,有一个usr测试类。希望与大家共同分享,学习!
本版本全面更新了jar包,全部使用了当前最新版本的jar包,struct2.1.8 spring3 hibernate3.5,全面使用注解取代xm的l配置。 另外增加了一个ant构建脚本,支持使用hudson完成每日构建,持续集成,自动测试,代码规范...
SSH整合包(struts2,spring4.3.9,hibernate5),SSH开发框架的依赖包,里面包括了commons-logging-1.1.1,struts和Spring的配置文件
Struts2.5+ Spring5 + Hibernater5.2整合后项目(包含jar包和配置文件)并且里面有直接运行案例
struts+spring+hibernte整合文档,文档中有图文解说,一步一步地教你怎么进行整合。好比如需要那些jar包,spring配置文件怎么配置,struts配置文件怎么配,web.xml里应该怎么配等。