<?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:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!-- mvc注解驱动,默认支持json转换 -->
<mvc:annotation-driven/>
<context:annotation-config></context:annotation-config> <!-- 注解扫描的包路径 -->
<context:component-scan base-package="wms.controller"/> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"
p:driverClass="com.mysql.jdbc.Driver"
p:jdbcUrl="jdbc:mysql://localhost:3306/test?useSSL=true"
p:user="root" p:password="1234"
p:maxPoolSize="40" p:minPoolSize="2" p:initialPoolSize="2" p:maxIdleTime="30" p:loginTimeout="10"
/> <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean" p:dataSource-ref="dataSource">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="org.hibernate.cache">true</prop>
<prop key="current_session_context_class">thread</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>wms.model</value>
</list>
</property>
</bean> <!-- 设定transactionManager -->
<bean id="txManager"
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean> <!--启动spring事务注解功能 -->
<tx:annotation-driven transaction-manager="txManager"/>
</beans>

spring mvc 基本配置的更多相关文章

  1. Spring MVC 事务配置

    Spring MVC事务配置 要了解事务配置的所有方法,请看一下<Spring事务配置的5种方法> 本文介绍两种配置方法: 一.      XML,使用tx标签配置拦截器实现事务 一.   ...

  2. spring mvc+myBatis配置详解

    一.spring mvc Spring框架(框架即:编程注解+xml配置的方式)MVC是Spring框架的一大特征,Spring框架有三大特征(IOC(依赖注入),AOP(面向切面),MVC(建模M- ...

  3. Maven 工程下 Spring MVC 站点配置 (三) C3P0连接池与@Autowired的应用

    Maven 工程下 Spring MVC 站点配置 (一) Maven 工程下 Spring MVC 站点配置 (二) Mybatis数据操作 前两篇文章主要是对站点和数据库操作配置进行了演示,如果单 ...

  4. Maven 工程下 Spring MVC 站点配置 (二) Mybatis数据操作

    详细的Spring MVC框架搭配在这个连接中: Maven 工程下 Spring MVC 站点配置 (一) Maven 工程下 Spring MVC 站点配置 (二) Mybatis数据操作 这篇主 ...

  5. Maven 工程下 Spring MVC 站点配置 (一)

    最近,查找一些具体资料时,虽然会有很多,但是系统的却很少,尤其是对maven 下 spring mvc 站点搭建的配置,总是说的很多但让新手一目了然的步骤却少之又少. 对此闲暇时整理了一下,做了一套较 ...

  6. Spring mvc系列一之 Spring mvc简单配置

    Spring mvc系列一之 Spring mvc简单配置-引用 Spring MVC做为SpringFrameWork的后续产品,Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块 ...

  7. Spring MVC的配置与DispatcherServlet的分析

    Spring MVC是一款Web MVC框架,是目前主流的Web MVC框架之一. Spring MVC工作原理简单来看如下图所示: 接下来进行Spring MVC的配置 首先我们配置Spring M ...

  8. Spring学习日志之Spring MVC启动配置

    对DispatcherServlet进行配置 Spring MVC的配置实际上就是对DispatcherServlet的配置 public class DispatcherServletConfig ...

  9. Spring MVC的配置和使用

    Spring MVC的配置和使用 笔记仓库:https://github.com/nnngu/LearningNotes Spring MVC需要的jar包 文章中 Spring MVC 使用的版本是 ...

  10. [转]Spring MVC 事务配置

    Spring MVC事务配置 要了解事务配置的所有方法,请看一下<Spring事务配置的5种方法> 本文介绍两种配置方法:  <tx:advice/>就是告诉事务管理器:怎么做 ...

随机推荐

  1. 楊輝三角C#版

    class Program { static void Main(string[] args) { Console.WriteLine("please input a number:&quo ...

  2. eclipse 中文或法文等语言注释错误解决办法 Some characters cannot be mapped using "GBK" character encoding

    这个问题会造成 无法修改包名.解决办法: Window->Preferences->Content Types->Text->Java Source File  Default ...

  3. django中models联合唯一unique_together

    例: 文章点赞 class ArticleUpDown(models.Model): """ 点赞表 """ nid = models.Au ...

  4. react学习之路-配制antd-mobile

    经过将近三个月的使用,现在终于在我老大的带领下做完了一个react的项目,感觉还可以,最大的不足就是,对于react中的很多的东西都是掺杂着jq使用来做的,这是最不满意的一点吧,但是开发进度很近,只能 ...

  5. [Flex] 修改注释中的@author方法

    当然,在Flash Builder里,按Ctrl+Shift+D可以很方便在添加AsDoc注释,也可以修改,可是有些生成的@author是系统的用户名(如:administor),如何修改 修改方法之 ...

  6. iOS核心动画之视觉效果

    圆角 cornerRadius确定圆角的大小 masksToBounds确定要不要裁减圆角以外的界面 图层边框 borderWidth 边框的粗细,point是衡量值. borderColor 边框的 ...

  7. c#中的classes和objects一些知识【1】

    首先我们需要知道面向对象语言(Object-oriented language)的三大特点:封装(Encapulation),继承(Inheritance),多态(Polymorphism). 引言: ...

  8. c语言-折半查找的函数

    void search(int n,int num[],char name[N][10]) { int top,bottom,middle,location,flag; top=0; bottom=N ...

  9. [web]深入理解Session和Cookie

    一.理解Cookie 由于http是一种无状态的协议,当用户的一次访问结束后,后端的服务器就无法知道下一次来访问的请求是不是上一次的用户了.那么Cookie的作用就是用户通过http访问一个服务器时, ...

  10. leetcode-771-Jewels and Stones(建立哈希表,降低时间复杂度)

    题目描述: You're given strings J representing the types of stones that are jewels, and S representing th ...