加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
beans.xml 8.62 KB
一键复制 编辑 原始数据 按行查看 历史
石凯 提交于 2020-02-28 15:55 . 代码
<?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:mvc="http://www.springframework.org/schema/mvc"
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-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">
<context:annotation-config></context:annotation-config>
<context:component-scan base-package="com"></context:component-scan>
<mvc:annotation-driven></mvc:annotation-driven>
<mvc:resources location="/js/" mapping="/js/**" />
<context:property-placeholder location="classpath:jdbc.properties" />
<!-- 数据源配置 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="maxActive" value="10" />
<property name="maxIdle" value="5" />
</bean>
<!-- 配置 sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<!-- 加载 sqlMapConfig.xml -->
<property name="configLocation" value="classpath:sqlMapConfig.xml"></property>
</bean>
<!-- 系统开始 -->
<!-- 配置 AdminDao -->
<bean id="adminDao" class="com.dao.AdminDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 JcbiaotiDao -->
<bean id="jcbiaotiDao" class="com.dao.JcbiaotiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 JcdaohangDao -->
<bean id="jcdaohangDao" class="com.dao.JcdaohangDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 JcpeizhiDao -->
<bean id="jcpeizhiDao" class="com.dao.JcpeizhiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 RizhiDao -->
<bean id="rizhiDao" class="com.dao.RizhiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 系统结束 -->
<!-- User开始 -->
<!-- 配置BumenDao -->
<bean id="bumenDao" class="com.dao.BumenDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置BuyuanDao -->
<bean id="buyuanDao" class="com.dao.BuyuanDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置BuzhiDao -->
<bean id="buzhiDao" class="com.dao.BuzhiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 UserDao -->
<bean id="userDao" class="com.dao.UserDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 UxinxiDao -->
<bean id="uxinxiDao" class="com.dao.UxinxiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 UxtypeDao -->
<bean id="uxtypeDao" class="com.dao.UxtypeDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 UyijianDao -->
<bean id="uyijianDao" class="com.dao.UyijianDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 RoleDao -->
<bean id="roleDao" class="com.dao.RoleDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- User结束 -->
<!-- Yonghu开始 -->
<!-- 配置ByumenDao -->
<bean id="byumenDao" class="com.dao.ByumenDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置ByuyuanDao -->
<bean id="byuyuanDao" class="com.dao.ByuyuanDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置ByuzhiDao -->
<bean id="byuzhiDao" class="com.dao.ByuzhiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 YhroleDao -->
<bean id="yhroleDao" class="com.dao.YhroleDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 YonghuDao -->
<bean id="yonghuDao" class="com.dao.YonghuDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 YxinxiDao -->
<bean id="yxinxiDao" class="com.dao.YxinxiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 YxtypeDao -->
<bean id="yxtypeDao" class="com.dao.YxtypeDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 YyijianDao -->
<bean id="yyijianDao" class="com.dao.YyijianDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- Yonghu结束 -->
<!-- Gonggao开始 -->
<!-- 配置 GgpinglunDao -->
<bean id="ggpinglunDao" class="com.dao.GgpinglunDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 GgtypeDao -->
<bean id="ggtypeDao" class="com.dao.GgtypeDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 GonggaoDao -->
<bean id="gonggaoDao" class="com.dao.GonggaoDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- Gonggao结束 -->
<!-- 配置 ShujuDao -->
<bean id="shujuDao" class="com.dao.ShujuDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjduochuDao -->
<bean id="sjduochuDao" class="com.dao.SjduochuDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjjianchuDao -->
<bean id="sjjianchuDao" class="com.dao.SjjianchuDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjlaiyuanDao -->
<bean id="sjlaiyuanDao" class="com.dao.SjlaiyuanDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjleixingDao -->
<bean id="sjleixingDao" class="com.dao.SjleixingDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjpinglunDao -->
<bean id="sjpinglunDao" class="com.dao.SjpinglunDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjqitaDao -->
<bean id="sjqitaDao" class="com.dao.SjqitaDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjshaochuDao -->
<bean id="sjshaochuDao" class="com.dao.SjshaochuDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 配置 SjxingtaiDao -->
<bean id="sjxingtaiDao" class="com.dao.SjxingtaiDao">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<!-- 通过mapper扫描的方式 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 注意使用 sqlSessionFactoryBeanName 和 value -->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
<property name="basePackage" value="com.mapper"></property>
</bean>
<!-- 设置上传文件最大值 1M=1*1024*1024(B)=1048576 bytes -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 设置默认编码 -->
<property name="defaultEncoding" value="utf-8"></property>
<!-- 上传最大大小5M-->
<property name="maxUploadSize" value="52424400"></property>
</bean>
<!-- 事物管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化