spring 配置文件收藏


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

<bean id="dataSource" 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="maxActive" value="${jdbc.maxActive}" />
<property name="maxIdle" value="${jdbc.maxIdle}" />
<property name="maxWait" value="${jdbc.maxWait}" />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="mappingLocations">
<list>
<value>classpath:com/jasgroup/**/persistence/entity/*.hbm.xml</value>
<value>classpath:cn/jasgroup/**/persistence/entity/*.hbm.xml</value>
</list>
</property>
<property name="mappingJarLocations">
<list>
<value>classpath:../lib/jasframework*.jar</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
${hibernate.dialect}
</prop>
<prop key="hibernate.max_fetch_depth">3</prop>
<prop key="hibernate.jdbc.fetch_size">100</prop>
<prop key="hibernate.jdbc.batch_size">3000</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.cascade">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">false</prop>
</props>
</property>
</bean>

<!-- config hibernate manger -->

<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<util:list id="beanList">
<ref bean="mappingJacksonHttpMessageConverter" />
</util:list>
</property>
</bean>
<bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property
</bean>

<aop:config>
<aop:aspect ref="cn.jasgroup.jasframework.log.business.interpector.LogInterpector">
<aop:pointcut expression="execution(public * cn.jasgroup.jasframework..*ServiceImpl.save*(..))" id="addLog" />
<aop:pointcut expression="execution(public * cn.jasgroup.jasframework..*ServiceImpl.update*(..))" id="updateLog" />
<aop:pointcut expression="execution(public * cn.jasgroup.jasframework..*ServiceImpl.delete*(..))" id="deleteLog" />
<aop:pointcut expression="execution(public * cn.jasgroup.jasframework..*ServiceImpl.export*(..))" id="exportLog" />
<aop:after-returning pointcut-ref="addLog" method="doAddLog" returning="returnVal" />
<aop:after-returning pointcut-ref="updateLog" method="doUpdateLog" returning="returnVal" />
<aop:after-returning pointcut-ref="deleteLog" method="doDeleteLog" returning="returnVal" />
<aop:after-returning pointcut-ref="exportLog" method="doExportLog" returning="returnVal" />
</aop:aspect>
</aop:config>

<aop:config>
<aop:aspect ref="cn.jasgroup.jasframework.privilege.business.interpector.PrivilegeInterpector">
<aop:pointcut expression="execution(public * cn.jasgroup.jasframework..*ServiceImpl.query*(..))" id="findpri" />
<aop:pointcut expression="execution(public * cn.jasgroup.jasframework..*ServiceImpl.queryInfo*(..))" id="queryInfopri" />
<aop:after-returning pointcut-ref="findpri" method="doFindcolumn" returning="returnVal" />
<aop:after-returning pointcut-ref="queryInfopri" method="doFindcolumn" returning="returnVal" />
</aop:aspect>
</aop:config>

<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>

<!-- SDE -->
<bean id="sdeDataSource" class="cn.jasgroup.gis.data.ArcSDEDataWarehouse">
<constructor-arg>
<map>
<entry key="namespace" value="leeds"></entry>
<entry key="dbtype" value="arcsde"></entry>
<entry key="server" value="${sde.server}"></entry>
<entry key="port" value="${sde.port}"></entry>
<entry key="instance" value="${sde.instance}"></entry>
<entry key="user" value="${sde.user}"></entry>
<entry key="password" value="${sde.password}"></entry>
<entry key="pool.minConnections" value="3"></entry>
<entry key="pool.maxConnections" value="48"></entry>
</map>
</constructor-arg>
</bean>
</beans>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值