`

applicationContext.xml

阅读更多
<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" -->
<!--" http://www.springframework.org/dtd/spring-beans.dtd"> -->

<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/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="configLocation">
			<value>classpath:hibernate.cfg.xml</value>
		</property>
	</bean>
	<bean id="st" class="org.jb.aop.St"></bean>
	<bean id="tm" class="org.jb.common.Tm"></bean>
	<bean id="authImpl" class="org.jb.aop.AuthImpl"></bean>
	<aop:config>
		<aop:aspect ref="authImpl">
			<aop:pointcut
				expression="execution(* org.jb.t309.team5.web.action.*.execute(..))"
				id="pc" />
			<aop:before method="authPermission" pointcut-ref="pc" />
		</aop:aspect>
	</aop:config>
	<bean id="myHibTxManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<tx:advice id="txAdvice" transaction-manager="myHibTxManager">
		<tx:attributes>
			<!-- 对get/load/search开头的方法要求只读事务 -->
			<tx:method name="get*" propagation="SUPPORTS"
				read-only="true" />
			<tx:method name="load*" propagation="SUPPORTS"
				read-only="true" />
			<tx:method name="search*" propagation="SUPPORTS"
				read-only="true" />
			<tx:method name="find*" propagation="SUPPORTS"
				read-only="true" />
			<!-- 对其它方法要求事务 -->
			<tx:method name="*" propagation="REQUIRED" />
		</tx:attributes>
	</tx:advice>
	<aop:config>
		<!-- 
			只对GoodsBiz添加事务支持,因为前面配置的transactionManager
			是专对Hibernate的事务管理器 。
		-->
		<aop:pointcut id="serviceMethods"
			expression="execution(* org.jb.t309.team5.biz.impl.*.*(..))" />
		<!-- 织入 -->
		<aop:advisor advice-ref="txAdvice"
			pointcut-ref="serviceMethods" />
	</aop:config>



	<!-- 1. DAO -->
	<bean id="commonDAO"
		class="org.jb.common.dao.hibimpl.CommonDAOHibImpl">
		<property name="sessionFactory">
			<ref local="sessionFactory" />
		</property>
	</bean>

	<!-- 用户相关user -->
	<bean id="userDAO" class="org.jb.t309.team5.dao.impl.UserDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="userBiz"
		class="org.jb.t309.team5.biz.impl.UserBizHibImpl">
		<property name="userDAO" ref="userDAO"></property>
	</bean>
	<bean name="/user"
		class="org.jb.t309.team5.web.action.UserAction" autowire="byType">
	</bean>
	<!-- 角色相关role -->
	<bean id="roleDAO" class="org.jb.t309.team5.dao.impl.RoleDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="roleBiz"
		class="org.jb.t309.team5.biz.impl.RoleBizHibImpl">
		<property name="roleDAO" ref="roleDAO"></property>
	</bean>
	<bean name="/role"
		class="org.jb.t309.team5.web.action.RoleAction">
		<property name="roleBiz" ref="roleBiz"></property>
	</bean>

	<!-- cstActivity相关 -->
	<bean id="cstActivityDao"
		class="org.jb.t309.team5.dao.impl.CstActivityDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="cstActivityBiz"
		class="org.jb.t309.team5.biz.impl.CstActivityBizHibImpl">
		<property name="cstActivityDAO" ref="cstActivityDao"></property>
	</bean>
	<bean name="/activity"
		class="org.jb.t309.team5.web.action.ActivityAction"
		autowire="byType">
	</bean>

	<!-- 客户相关customer -->
	<bean id="customerDAO"
		class="org.jb.t309.team5.dao.impl.CstCustomerDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="customerBiz"
		class="org.jb.t309.team5.biz.impl.CstCustomerBizHibImpl"
		autowire="byType">
	</bean>
	<bean name="/customer"
		class="org.jb.t309.team5.web.action.CustomerAction"
		autowire="byType">
	</bean>

	<!-- 机会相关chance -->
	<bean id="chanceDAO"
		class="org.jb.t309.team5.dao.impl.SalChanceDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="chanceBiz"
		class="org.jb.t309.team5.biz.impl.SalChanceBizHibImpl">
		<property name="salChanceDAO" ref="chanceDAO"></property>
	</bean>
	<bean name="/chance"
		class="org.jb.t309.team5.web.action.ChanceAction">
		<property name="salChanceBiz" ref="chanceBiz"></property>
		<property name="userBiz" ref="userBiz"></property>
	</bean>

	<!-- 数据字典相关dict -->
	<bean id="dictDAO"
		class="org.jb.t309.team5.dao.impl.BaseDictDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="dictBiz"
		class="org.jb.t309.team5.biz.impl.BaseDictBizHibImpl">
		<property name="basDictDAO" ref="dictDAO"></property>
	</bean>
	<bean name="/dict" class="org.jb.t309.team5.web.action.DictAction"
		autowire="byType">

	</bean>

	<!-- 计划相关plan -->
	<bean id="planDAO"
		class="org.jb.t309.team5.dao.impl.SalPlanDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="planBiz"
		class="org.jb.t309.team5.biz.impl.SalPlanBizHibImpl"
		autowire="byType">
	</bean>
	<bean name="/plan" class="org.jb.t309.team5.web.action.PlanAction"
		autowire="byType">
	</bean>
	<!-- 联系人相关linkman -->
	<bean id="linkmanDao"
		class="org.jb.t309.team5.dao.impl.CstLinkmanDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="cstLinkmanBiz"
		class="org.jb.t309.team5.biz.impl.CstLinkmanBizHibImpl">
		<property name="linkmanDao" ref="linkmanDao"></property>
	</bean>
	<bean name="/cstLinkman"
		class="org.jb.t309.team5.web.action.CstLinkmanAction">
		<property name="cstLinkmanBiz" ref="cstLinkmanBiz"></property>
		<property name="customerBiz" ref="customerBiz"></property>
	</bean>

	<!-- 服务相关service -->
	<bean id="serviceDao"
		class="org.jb.t309.team5.dao.impl.CstServiceDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="serviceBiz"
		class="org.jb.t309.team5.biz.impl.CstServiceBizHibImpl">
		<property name="serviceDao" ref="serviceDao"></property>
	</bean>
	<bean name="/service"
		class="org.jb.t309.team5.web.action.ServiceAction">
		<property name="serviceBiz" ref="serviceBiz"></property>
		<property name="userBiz" ref="userBiz"></property>
		<property name="customerBiz" ref="customerBiz"></property>
		<property name="dictBiz" ref="dictBiz"></property>
	</bean>

	<!-- 历史订单 history order -->
	<bean id="vOrdersDao"
		class="org.jb.t309.team5.dao.impl.VOrdersDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="vOrdersBiz"
		class="org.jb.t309.team5.biz.impl.VOrdersBizHibImol"
		autowire="byType">
	</bean>
	<bean name="/orders"
		class="org.jb.t309.team5.web.action.OrdersAction" autowire="byType">
	</bean>
	<!-- 客户服务分析 -->
	<bean name="/svrRpt"
		class="org.jb.t309.team5.web.action.SvrRptAction">
		<property name="serviceBiz" ref="serviceBiz"></property>
	</bean>
	<!-- 产品信息product -->
	<bean id="poductDAO"
		class="org.jb.t309.team5.dao.impl.ProductDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="productBiz"
		class="org.jb.t309.team5.biz.impl.ProductBizHibImpl"
		autowire="byType">
	</bean>
	<bean name="/product"
		class="org.jb.t309.team5.web.action.ProductAction"
		autowire="byType">
	</bean>

	<!-- 定时间检查 -->
	<bean id="lostDao"
		class="org.jb.t309.team5.dao.impl.CstLostDAOHibImpl"
		parent="commonDAO">
	</bean>
	<bean id="lostBiz"
		class="org.jb.t309.team5.biz.impl.CstLostBizHibImpl"
		autowire="byType">
	</bean>
	<bean name="/lost" class="org.jb.t309.team5.web.action.LostAction"
		autowire="byType">
	</bean>
	<!-- 客户贡献分析 -->
	<bean name="/contrRpt" class="org.jb.t309.team5.web.action.ContrRptAction" autowire="byType">
	</bean>
	
	<bean id="jobLost"
		class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
		<property name="targetObject" ref="lostBiz"></property>
		<property name="targetMethod" value="checkLost"></property>
	</bean>

	<bean id="cron"
		class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail" ref="jobLost"></property>
		<property name="cronExpression">
			<value>0 30 2 ? * SAT</value>
		</property>
	</bean>

	<bean autowire="no"
		class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="triggers">
			<list>
				<ref local="cron" />
			</list>
		</property>
	</bean>
	<!-- 客户流失分析 -->
	<bean name="/lostRpt"
		class="org.jb.t309.team5.web.action.LostRptAction"
		autowire="byType">
	</bean>

	<!-- 客户构成分析 -->
	<bean name="/consRpt"
		class="org.jb.t309.team5.web.action.ConsRptAction"
		autowire="byType">
	</bean>
	
	<!-- 库存查询 -->
	<bean id="storageDAO" class="org.jb.t309.team5.dao.impl.VStorageDAOHibImpl" parent="commonDAO"></bean>
	<bean id="storageBiz" class="org.jb.t309.team5.biz.impl.VStorageBizHibImpl" autowire="byType"></bean>
	<bean name="/storage" class="org.jb.t309.team5.web.action.StorageAction"  autowire="byType"></bean>
	
	<!-- 详细权限相关 -->
	<bean id="detailRoleDAO" class="org.jb.t309.team5.dao.impl.DetailRoleDAOHibImpl" parent="commonDAO"></bean>
	<bean id="detailRoleBiz" class="org.jb.t309.team5.biz.impl.DetailRoleBizHibImpl" autowire="byType"></bean>
	<bean name="/detailRole" class="org.jb.t309.team5.web.action.DetailRoleAction" autowire="byType"></bean>
</beans>
分享到:
评论

相关推荐

    applicationContext.xml 详细配置

    ApplicationContext.xml 配置详解 ApplicationContext.xml 是 Spring 框架中用于配置应用程序的核心配置文件。通过该文件,可以定义 Bean、数据源、Session 工厂、 Hibernate 配置等相关信息,从而实现应用程序的...

    applicationContext.xml详解

    ApplicationContext.xml详解 ApplicationContext.xml是Spring框架中的核心配置文件,它是Spring的IOC(Inverse of Control,控制反转)容器的核心组件。该文件用于定义和配置Spring应用程序中的各种Bean,对于...

    struts.xml和applicationContext.xml、web.xml的配置

    在Java Web开发中,`struts.xml`, `applicationContext.xml` 和 `web.xml` 是三个至关重要的配置文件,它们各自负责不同的职责,并协同工作来构建一个完整的应用框架。以下是关于这三个配置文件的详细说明。 首先,...

    applicationContext.xml等文件.rar

    在IT行业中,尤其是在Java Web开发领域,`applicationContext.xml`、`db.properties`、`log4j.properties`以及`spring-mvc.xml`等文件是非常关键的配置文件,它们各自负责不同的功能,对于一个完整的应用程序来说不...

    spring3.0 + Quartz1.52 + applicationContext.xml

    这个压缩包“spring3.0 + Quartz1.52 + applicationContext.xml”显然是一个关于如何在Spring 3.0环境中集成Quartz 1.52版本的示例或教程资源。 首先,`applicationContext.xml`是Spring框架的核心配置文件,它定义...

    SSH框架applicationContext.xml头部文件

    ### SSH框架applicationContext.xml头部文件知识点解析 #### 一、SSH框架简介 SSH框架是Struts+Spring+Hibernate三个开源框架的组合,是中国开发者对这三个框架整合应用的一种简称。其中Struts负责MVC(Model-View-...

    Spring 2.5-applicationContext.xml提示信息的配置

    在Spring框架中,`applicationContext.xml`是应用上下文的核心配置文件,用于定义bean的创建、依赖关系以及各种服务的配置。这篇博文“Spring 2.5 - applicationContext.xml提示信息的配置”主要探讨了如何在Spring ...

    ApplicationContext.xml

    《ApplicationContext.xml——Spring框架的核心配置文件详解》 在Java开发领域,Spring框架是不可或缺的一部分,它以其强大的依赖注入(Dependency Injection,简称DI)和面向切面编程(Aspect-Oriented ...

    SSH中applicationContext.xml如何配制事务

    在SSH的applicationContext.xml 中如何配制配制事务

    applicationContext.xml用法

    ### Spring的applicationContext.xml文件详解 #### 一、引言 在Java开发领域,Spring框架因其强大的功能和灵活的设计而受到广泛欢迎。其中,`applicationContext.xml`是Spring框架的核心配置文件之一,它用于管理...

    spring+jpa的applicationContext.xml配置

    spring+jpa的applicationContext.xml配置

    ssm框架基础配置文件web.xml模板springmvc.xml模板applicationContext.xml模板拿来即用

    3. **applicationContext.xml**:这是Spring的上下文配置文件,主要管理服务层(Service)和数据访问层(DAO)的Bean。包括Bean的定义、依赖注入(DI)、事务管理、AOP(面向切面编程)等配置。 - Bean定义:使用`...

    ssm applicationContext.xml,SpringMVC,web设置

    这是一些配置文件,可以作为参考,个人感觉很方便的学习方法

Global site tag (gtag.js) - Google Analytics