<?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:context="http://www.springframework.org/schema/context"
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/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!--spring 的配置要用annotation来配置 -->
<!-- <context:annotation-config /> -->
<!-- 按照包的方式浏览组件,自动检测组件 -->
<context:component-scan base-package="com.derong.auction" />
<!-- 设置来读取properties文件 -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:jdbc.properties</value>
</property>
</bean>
<!-- 数据源 -->
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="maxIdle" value="${jdbc.maxIdle}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxWait" value="${jdbc.maxWait}"/>
</bean>
<!-- 配置sessionFactory -->
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingLocations">
<value>classpath:com/derong/auction/model/*.hbm.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
<!-- <prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop> -->
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.connection.SetBigStringTryClob">true</prop>
</props>
</property>
</bean>
<!-- 将sessionFactory注入到hibernateTemplate -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="mySessionFactory"></property>
</bean>
<!-- 将hibernateTemplate注入到*daoImpl -->
<bean id="commonDaoImpl" class="com.derong.auction.dao.impl.CommonDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tAdminsDaoImpl" class="com.derong.auction.dao.impl.TAdminsDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tAgeAmountDaoImpl" class="com.derong.auction.dao.impl.TAgeAmountDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tBidRecordDaoImpl" class="com.derong.auction.dao.impl.TBidRecordDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tChinawareDaoImpl" class="com.derong.auction.dao.impl.TChinawareDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tCollectionDaoImpl" class="com.derong.auction.dao.impl.TCollectionDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tEstimateDaoImpl" class="com.derong.auction.dao.impl.TEstimateDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tGoodsCommonDaoImpl" class="com.derong.auction.dao.impl.TGoodsCommonDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tLandDaoImpl" class="com.derong.auction.dao.impl.TLandDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tMemberDaoImpl" class="com.derong.auction.dao.impl.TMemberDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tPaintingDaoImpl" class="com.derong.auction.dao.impl.TPaintingDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="tPictrueDaoImpl" class="com.derong.auction.dao.impl.TPictrueDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<bean id="visitorDaoImpl" class="com.derong.auction.dao.impl.VisitorDaoImpl">
<property name="ht" ref="hibernateTemplate"></property>
</bean>
<!-- 将*DaoImpl注入到*ServiceImpl -->
<bean id="AdminServiceImpl" class="com.derong.auction.service.impl.AdminServiceImpl">
<property name="tChinawareDao" ref="tChinawareDaoImpl"></property>
<property name="tPaintingDao" ref="tPaintingDaoImpl"></property>
<property name="tLandDao" ref="tLandDaoImpl"></property>
<property name="tGoodsCommonDao" ref="tGoodsCommonDaoImpl"></property>
<property name="tPictrueDao" ref="tPictrueDaoImpl"></property>
<property name="tEstimateDao" ref="tEstimateDaoImpl"></property>
<property name="tMemberDao" ref="tMemberDaoImpl"></property>
<property name="tAgeAmountDao" ref="tAgeAmountDaoImpl"></property>
<property name="tAdminsDao" ref="tAdminsDaoImpl"></property>
</bean>
<bean id="CommonServiceImpl" class="com.derong.auction.service.impl.CommonServiceImpl">
<property name="tChinawareDao" ref="tChinawareDaoImpl"></property>
<property name="tPaintingDao" ref="tPaintingDaoImpl"></property>
<property name="tLandDao" ref="tLandDaoImpl"></property>
<property name="tMemberDao" ref="tMemberDaoImpl"></property>
<property name="tBidRecordDao" ref="tBidRecordDaoImpl"></property>
<property name="tGoodsCommonDao" ref="tGoodsCommonDaoImpl"></property>
<property name="tEstimateDao" ref="tEstimateDaoImpl"></property>
<property name="commonDao" ref="commonDaoImpl"></property>
</bean>
<bean id="MemberServiceImpl" class="com.derong.auction.service.impl.MemberServiceImpl">
<property name="tMemberDao" ref="tMemberDaoImpl"></property>
<property name="tEstimateDao" ref="tEstimateDaoImpl"></property>
<property name="tCollectionDao" ref="tCollectionDaoImpl"></property>
<property name="tGoodsCommonDao" ref="tGoodsCommonDaoImpl"></property>
<property name="tBidRecordDao" ref="tBidRecordDaoImpl"></property>
<property name="tChinawareDao" ref="tChinawareDaoImpl"></property>
<property name="tPaintingDao" ref="tPaintingDaoImpl"></property>
<property name="tLandDao" ref="tLandDaoImpl"></property>
<property name="commonDao" ref="commonDaoImpl"></property>
</bean>
<bean id="VistorServiceImpl" class="com.derong.auction.service.impl.VistorServiceImpl">
<property name="tMemberDao" ref="tMemberDaoImpl"></property>
</bean>
<!-- 配置Spring定时器开始(最后添加的功能)开始 -->
<!--配置Spring定时器 -->
<bean id="settlementAction" class="com.derong.auction.action.SettlementAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<bean id="scheduleReportTask" class="org.springframework.scheduling.timer.ScheduledTimerTask">
<property name="timerTask" ref="settlementAction" />
<property name="period" value="3000"></property>
</bean>
<bean class="org.springframework.scheduling.timer.TimerFactoryBean">
<property name="scheduledTimerTasks" ref="scheduleReportTask"></property>
</bean>
<!-- 配置Spring定时器开始(最后添加的功能)结束 -->
<!-- 将*ServiceImpl注入到*Action -->
<bean id="loginAction" class="com.derong.auction.action.LoginAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
<property name="memberServiceImpl" ref="MemberServiceImpl"></property>
</bean>
<!-- 添加scope属性是为了解决detached entity passed to persist异常的 -->
<bean id="registerAction" class="com.derong.auction.action.RegisterAction" scope="prototype">
<property name="vistorServiceImpl" ref="VistorServiceImpl"></property>
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
</bean>
<bean id="managerLoginAction" class="com.derong.auction.action.ManagerLoginAction">
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<bean id="managerOperateAction" class="com.derong.auction.action.ManagerOperateAction" scope="prototype">
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<bean id="userOperateAction" class="com.derong.auction.action.UserOperateAction" >
<property name="memberServiceImpl" ref="MemberServiceImpl"></property>
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
</bean>
<bean id="joinEvaluateAction" class="com.derong.auction.action.JoinEvaluateAction" scope="prototype">
<property name="memberServiceImpl" ref="MemberServiceImpl"></property>
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
</bean>
<bean id="searchAuctionAction" class="com.derong.auction.action.SearchAuctionAction" scope="prototype">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<bean id="indexAction" class="com.derong.auction.action.IndexAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
</bean>
<bean id="auctionClassAction" class="com.derong.auction.action.AuctionClassAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
</bean>
<bean id="validateAction" class="com.derong.auction.action.ValidateAction">
<property name="vistorServiceImpl" ref="VistorServiceImpl"></property>
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
</bean>
<bean id="modifyChinaAction" class="com.derong.auction.action.ModifyChinaAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<bean id="modifyArtistAction" class="com.derong.auction.action.ModifyArtistAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<bean id="modifyLandAction" class="com.derong.auction.action.ModifyLandAction">
<property name="commonServiceImpl" ref="CommonServiceImpl"></property>
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<!-- 及时通知 -->
<bean id="promptAction" class="com.derong.auction.action.PromptAction" scope="session">
<property name="memberServiceImpl" ref="MemberServiceImpl"/>
</bean>
<bean id="getChart" class="com.derong.auction.action.AgeStatisticAction">
<property name="adminServiceImpl" ref="AdminServiceImpl"></property>
</bean>
<!-- jfreechart 配置开始 -->
<!-- jfreechart 配置结束 -->
<!-- 验证码配置开始 -->
<!-- 验证码配置结束 -->
<!-- 配置HibernateTransactionManager,并且将sessionfactory注入到myTxManager -->
<bean id="myTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="mySessionFactory" />
</bean>
<!-- 建立切面逻辑,逻辑由hibernateTransactionManager来实现 -->
<tx:advice id="txAdvice" transaction-manager="myTxManager">
<tx:attributes>
<!-- <tx:method name="get*" read-only="true" /> -->
<tx:method name="*" />
</tx:attributes>
</tx:advice>
<!-- 建立切面和切面逻辑的(advisor)映射 -->
<aop:config>
<aop:pointcut id="businessService"
expression="execution(public * com.derong.auction.service..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="businessService" />
</aop:config>
</beans>
分享到:
相关推荐
ssi整合时spring的总配置文件·
`org.springframework.beans.factory.config.PropertyPlaceholderConfigurer` 是Spring框架中的一个重要组件,主要负责处理配置文件中的占位符替换。这个类是Spring在初始化bean时用来解析和注入环境变量或系统属性...
在eclipose 中引入spring-beans.dtd 可以在不联网的时候编辑XML自动提示
spring-beans-writer用来生成spring IOC的配置文件,可以自动写入简单类型以及List、Map等复杂类型的值。示例如下:SpringBeans ..."spring_beans.xml"))); sbw.write(beans, outputs); 标签:spring
使用`openbean.jar`和`java.beans`包可以帮助你在Android应用中实现一些高级功能,例如动态属性操作、事件处理和XML序列化。但是,需要注意的是,由于Android环境的限制,某些JavaBeans的功能可能无法完全实现,或者...
这是一个springmvc-config.xml文件,<?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" ...
`beans.xml`管理应用对象,`servlet-context.xml`定义Spring MVC的处理逻辑,`mybatis-config.xml`配置MyBatis的数据访问,而`web.xml`则作为应用的入口,协调各个组件的启动和运行。理解并熟练配置这些文件,对于...
在上面的代码中,我们首先创建了一个 `FileSystemResource` 对象,指向了文件系统中的 `beans.xml` 文件,然后将其传递给 `XmlBeanFactory` 构造函数,以实例化一个 BeanFactory。 如果 `beans.xml` 文件不在项目的...
org.springframework.beans org.springframework.beans.annotation org.springframework....org.springframework.beans.factory.xml org.springframework.beans.propertyeditors org.springframework.beans.support
2013-3-20 22:22:46 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [beans.xml] 2013-3-20 22:22:49 org....
### Struts框架中struts-config.xml文件配置详解 #### 一、引言 在Java Web开发领域,Struts是一个非常重要的MVC(Model-View-Controller)框架,它极大地简化了Web应用程序的开发过程。而在Struts框架中,`struts...
2. **`<form-beans>`**: 定义表单bean,这些bean对应于用户界面中的HTML表单。每个`<form-bean>`元素表示一个Java Bean,用于封装表单数据,并在请求之间持久化。 3. **`<global-forwards>`**: 全局转发...
相较于Heritrix 1.x的`order.xml`,`crawler-beans.cxml` 采用了Spring框架进行管理,以bean的形式定义了各种组件,提高了配置的灵活性和可维护性。 1. **simpleOverrides**:这个bean用于设置基本的爬取任务信息,...
《Spring Beans 模块详解与版本差异分析》 Spring框架是Java开发中广泛使用的轻量级框架,其中Spring Beans模块是其核心组成部分,它负责管理对象的生命周期和依赖注入。本篇文章将深入探讨Spring Beans的功能特性...
at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:266) at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:327) at org.jvnet.jax_ws_commons.spring....
在这个项目中,数据源配置位于`beans.xml`文件中。`beans.xml`是Spring框架的配置文件,通常包含Bean的定义和依赖关系,数据源的配置意味着这里定义了连接数据库所需的参数,如数据库URL、用户名、密码等。 数据库...
DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> ``` 这部分定义了XML文档的基本属性,包括版本号和字符编码。DOCTYPE声明引用了Spring的DTD(Document ...
### SSH框架applicationContext.xml头部文件知识点解析 #### 一、SSH框架简介 SSH框架是Struts+Spring+Hibernate三个开源框架的组合,是中国开发者对这三个框架整合应用的一种简称。其中Struts负责MVC(Model-View-...
3、web.xml里配置spring监听器,及其加载的beans.xml,把cxf-servlet.xml删掉,发布到WEB服务器即可,注意这种方式在必须需要本地wsdl文件 手动放在src下,默认发布到web服务器的路径为WEB-INF/classes/xxx.wsdl ...