web.xml中配置
<filter>
<filter-name>opensession</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>opensession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
注意:该配置必须在struts配置之上,否则失效。
applicationContext.xml中配置
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
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="sessionFactory"></property>
</bean>
<tx:advice id="advice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED" read-only="true"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="serviceMethod" expression="execution(* org.jboa.service.impl.*.*(..))" />
<aop:advisor advice-ref="advice" pointcut-ref="serviceMethod"/>
</aop:config>
分享到:
相关推荐
在SSH中使用事物包括SSH的搭建和配置;事务的配置;注释详细。(完整项目)
J2EE SSH事务配置 J2EE SSH事务配置 J2EE SSH事务配置 J2EE SSH事务配置
SSH笔记-事务管理,包含通过注解的方式配置事务和通过xml的方式配置事务
ssh框架事务管理applicationContext.xml配置文件
各种事物配置方法。用于工作学习都可以获得很好的知识积累
ssh事务配置.txt ssh事务配置.txt ssh事务配置.txt
SSH框架加入事务支持,其中Spring为2.0的!
SSH整合,纯注解,包含事务,零配置,代码高度复用
需要的jar包 aopalliance.jar aspectjrt.jar aspectjweaver.jar
Struts1+Spring+Hibernate的整合过程,及其相关配置 事务的处理机制 Log4j的配置过程
可以看到配置文件的步骤: 1、 配置数据源 ...4、 Spring中声明事务管理器(根据需要又可分为几种,但都要依赖注入上面的事务管理器,此外还需要配置transationAttributes) 后面的一些普通的bean配置就不用说了
2、配置文件在src/conf 3、bpmn/leave.bpmn.xml 4、注意不要重复提交 5、如果不需要memcache就关闭掉,如果用,就执行《必要设置.txt》 jBPM流程 先用user登陆,创建请假task ,count填10,然后系统会自动生成pm的...
今天特意将项目中用Axis2集成SSH实现WebService的过程记录下来,一...3.灵活配置,在一个项目中配置多个WebService的调用接口。 4.顺便提一种方案,让我们的WebService更加安全。 5.提供测试例子,服务端客户端都有了。
先配置事务管理器,注意现在使用的是Hibernate框架,所以需要使用Hibernate框架的事务管理器
里面有我做公司项目前用MyEclipse搭建ssh框架测试通过后的一个项目,此项目添加了aop和事务支持,有完整的action测试; 还有自己做的3到4页的MyEclipse搭建SSH的傻瓜式教程,还有oracle数据库连接引擎的配置的图片...
SSH的简单工程框架,有LOG管理,有事务管理,有三个框架的衔接,maven的配置
从此不用再自己编写配置,采用企业化的框架设计。最近,负责开发项目,很多人对SSH框架配置出错表示很头痛,我自己配置好了通用框架分享给大家。SPRING配置文件中包括了日志处理和事务管理。
-- 事务配置 --> <!-- JTA环境的事务配置 WebLogicJtaTransactionManager"/> --> <!-- 使用annotation定义事务 --> <!-- 保证POJO中标注@Required的属性被注入 --> </beans>
SSH框架整合录像 解决包冲突 sessionFactory 问题 project的命名经验 事务的配置
SSH(struts+spring+hibernate)的jar包 SSH 通常指的是 Struts2 做前端控制器,Spring 管理各层的组件,Hibernate 负责持久化层。 一个请求在Struts2框架中的处理大概分为以下几个步骤: 1、客户端初始化一个指向...