ssm整合之applicationContext.xml
<?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.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<!--开启注解的扫描,希望处理service和dao,controller不需要Spring框架去处理-->
<context:component-scan base-package="com.ityw" >
<!--配置哪些注解不扫描-->
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!--Spring整合MyBatis框架-->
<!--配置连接池-->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql:///ssm_ityw"/>
<property name="user" value="root"/>
<property name="password" value="root"/>
</bean>
<!--配置SqlSessionFactory工厂-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
<!--配置AccountDao接口所在包-->
<bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.ityw.dao"/>
</bean>
<!--配置Spring框架声明式事务管理-->
<!--配置事务管理器-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!--配置事务通知-->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="find*" read-only="true"/>
<tx:method name="*" isolation="DEFAULT"/>
</tx:attributes>
</tx:advice>
<!--配置AOP增强-->
<aop:config>
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.ityw.service.impl.*ServiceImpl.*(..))"/>
</aop:config>
</beans>
ssm整合之applicationContext.xml的更多相关文章
- SSH整合,applicationContext.xml中配置hibernate映射文件问题
今天在applicationContext.xml中配置sessionFactory时遇到了各种头疼的问题,现在总结一下: 1.<property name="mappingDirec ...
- ssm框架中applicationContext.xml文件中配置别名
在applicationContext.xml中配置如下: 通过以下property标签中给定name属性value属性及对应的值,来将domain包下所有实体类设置别名. 在xxxDao.xml中 ...
- ssm整合之web.xml文件
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" " ...
- ssm整合的spring.xml文件配置(applicationContext.xml)
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
- ssm整合(基于xml配置方式)
本文是基于xml配置的方式来整合SpringMVC.Spring和Mybatis(基于注解的方式会再写一篇文章),步骤如下: (1)首先自然是依赖包的配置文件 pom.xml <project ...
- ssm整合的springmvc.xml的配置
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
- SSM整合的pom.xml依赖
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- ssm整合之springmvc.xml文件
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
- 零基础学习java------39---------json格式交互,Restful(不懂),静态资源映射,SSM整合(ssm整合思想,application.xml文件详解(声明式事务管理),)
一. json格式交互(知道) 1 . 回顾ajax基本语法 $.ajax({ url:"", // 请求的后台路径 data:{"":"" ...
随机推荐
- 关于swagger
转自https://blog.csdn.net/sanyaoxu_2/article/details/80555328 1:认识Swagger Swagger 是一个规范和完整的框架,用于生成.描述. ...
- netty字符串流分包
@Override protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf in, List<Obj ...
- python与Oracle
1.python 3.6.6 2.使用cx_Oracle -----------安装方法:pip install cx_Oracle 3.游标 cursor -----游标是系统为用户开创的 ...
- Oracle学习(三)SQL高级--表结构相关(建表、约束)
一.建表语句 CREATE DATABASE(创建数据库) --创建数据库 create database 数据库名字; CREATE TABLE(创建表) --创建表 CREATE TABLE 表名 ...
- 刷题[GWCTF 2019]mypassword
解题思路 打开网站,登陆框.注册一个用户后再登陆 看样子是注入了,在feedback.php中发现注释 <!-- if(is_array($feedback)){ echo "< ...
- P3378 堆(模板)
P3378 [模板]堆 题目描述 给定一个数列,初始为空,请支持下面三种操作: 给定一个整数 x,请将 x 加入到数列中. 输出数列中最小的数. 删除数列中最小的数(如果有多个数最小,只删除 1 个) ...
- 一种基于均值不等式的Listwise损失函数
一种基于均值不等式的Listwise损失函数 1 前言 1.1 Learning to Rank 简介 Learning to Rank (LTR) , 也被叫做排序学习, 是搜索中的重要技术, 其目 ...
- Web前后端:如何分离,如何解耦?
摘要:在本文中我们一起来探讨一下为什么要在软件开发中进行前后端的分离,如何做到前后端分离,如何解耦. 简单地说,就是要把复杂的问题简单化,把一个从0到N的问题转化为N个0到1的问题.另一个相近的说法就 ...
- 多测师讲解html _图片标签003_高级讲师肖sir
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>段 ...
- IdentityServer 3.1.x 迁移到 4.x
一.前言 IdentityServer4 4.x已经正式发布了,根据官方的 Release Note,3.1.x 到 4.x 的变更也是非常多,今天在将代码迁移到 4.x 遇到了一些问题在此记录下来, ...