1 在主容器中(applicationContext.xml),将Controller的注解打消掉

  1. <context:component-scan base-package="com">
  2. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  3. </context:component-scan>

2 而在springMVC配置文件中将Service注解给去掉 

  1. <context:component-scan base-package="com">
  2. <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  3. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
  4. </context:component-scan>

因为spring的context是父子容器,所以会产生冲突,Controller会进步前辈行扫描装配,而此时的Service还没有进行事务的加强处理惩罚,获得的将是原样的Service(没有经过事务加强处理惩罚,故而没有事务处理惩罚才能) ,最后才是applicationContext.xml中的扫描设备进行事务处理惩罚

spring的context:exclude-filter 与 context:include-filter的更多相关文章

  1. Spring context:component-scan中使用context:include-filter和context:exclude-filter

    Spring context:component-scan中使用context:include-filter和context:exclude-filter XML: <?xml version= ...

  2. Spring MVC中<mvc:annotation-driven />和<context:annotation-config />的区别分析

    个人最简单的使用理解: <mvc:annotation-driven />是管理静态资源的,比如静态页面,返回JSON这些. <context:annotation-config / ...

  3. Web.xml详解(转)(Filter,context,listener)

    web.xml 详细解释!!(链接) web.xml加载过程(步骤) 首先简单说一下,web.xml的加载过程. 当我们去启动一个WEB项目时,容器包括(JBoss.Tomcat等)首先会读取项目we ...

  4. Spring MVC 项目搭建 -6- spring security 使用自定义Filter实现验证扩展资源验证,使用数据库进行配置

    Spring MVC 项目搭建 -6- spring security使用自定义Filter实现验证扩展url验证,使用数据库进行配置 实现的主要流程 1.创建一个Filter 继承 Abstract ...

  5. Spring Security 入门(1-6-2)Spring Security - 内置的filter顺序、自定义filter、http元素和对应的filterChain

    Spring Security 的底层是通过一系列的 Filter 来管理的,每个 Filter 都有其自身的功能,而且各个 Filter 在功能上还有关联关系,所以它们的顺序也是非常重要的. 1.S ...

  6. Spring Boot 2 实战:如何自定义 Servlet Filter

    1.前言 有些时候我们需要在 Spring Boot Servlet Web 应用中声明一些自定义的 Servlet Filter 来处理一些逻辑.比如简单的权限系统.请求头过滤.防止 XSS 攻击等 ...

  7. context:component-scan" 的前缀 "context" 未绑定。

    SpElUtilTest.testSpELLiteralExpressiontestSpELLiteralExpression(cn.zr.spring.spel.SpElUtilTest)org.s ...

  8. 元素 "context:component-scan" 的前缀 "context" 未绑定的解决方案

    在动态web项目(Dynamic Web Project)中,使用SpringMVC框架,新建Spring的配置文件springmvc.xml,添加扫描控制器 <context:componen ...

  9. Android中,Context,什么是Context?

    注:本文翻译自Context, What Context?,原文链接在这里,作者是Dave Smith.ps:译者链接http://blog.csdn.net/race604/article/deta ...

  10. dedecms /include/filter.inc.php Local Variable Overriding

    catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 filter.inc.php这个文件在系统配置文件之后,里面有forea ...

随机推荐

  1. 数据绑定(四)使用DataContext作为Binding的Source

    原文:数据绑定(四)使用DataContext作为Binding的Source DataContext属性被定义在FrameworkElement类里,这个类是WPF控件的基类,这意味着所有WPF控件 ...

  2. VS生成Cordova for Android应用之Gradle

    原文:VS生成Cordova for Android应用之Gradle 一.Gradle简介 Gradle是一个基于Apache Ant和Apache Maven概念的项目自动化建构工具.它使用一种基 ...

  3. NET C#创建WINDOWS系统用户

    原文:NET C#创建WINDOWS系统用户   /前提是当前用户有相应的权限 /WinNT用户管理 using System; using System.DirectoryServices;  na ...

  4. hadoop(三)

    hadoop(三) 1.对MapReduce的认识   MapReduce是运行在yarn上面的一个分布式运算框架,它是用来解决海量的分布式运算的.对于MapReduce来说,我们可以把它分成两部分来 ...

  5. Channel 9视频整理【1】

    David Dong 微软mvp https://www.​facebook.com/​DotNet​Walker http://s​tudyhost.​blogspot.tw/ https://ch ...

  6. 在Windows IoT上使用网络摄像头

    在树莓派上可以使用它官方标配的摄像头,但是这个摄像头似乎不能被Windows IoT识别和使用.但是,可以在树莓派的USB口上插入任意型号的摄像头,就可以实现树莓派的拍摄功能. 关于摄像头的寻找和拍摄 ...

  7. Windows RabbitMQ 安装

    操作系统 Win10  企业版 目标: 在win10上安装RabbitMQ 安装步骤 1.安装RabbitMQ需要先安装Erlang语言开发包,下载地址:http://www.erlang.org/d ...

  8. Zookeeper 部署Zookeeper仲裁模式集群

    部署Zookeeper仲裁模式集群 本例在一台服务器上部署3个zk服务:z1.z2.z3. 1.下载Zookeeper https://zookeeper.apache.org/ 2.解压缩 .tar ...

  9. The Portable Executable File Format from Top to Bottom(每个结构体都非常清楚)

    The Portable Executable File Format from Top to Bottom Randy KathMicrosoft Developer Network Technol ...

  10. QT信号槽的六个优点(虽然直接调用函数也可解决问题,但要在具体的函数中传递指针,多对一和解除关系也够麻烦的)

    信号槽是Qt中特有的概念.它使得程序员将不同的object绑定起来,而object对象间并不需要对相互了解. Slots也是普通的c++方法,它们可以是virtual;可以被重载;可以使private ...