zoukankan      html  css  js  c++  java
  • Spring 注解过滤

     
    <!-- 自动扫描,base-package 属性指定了需要扫描的类包,类包及其递归子包中所有的类都会被处理-->
        <context:component-scan base-package="com.chen">
     
            <!-- 排除模拟实现类
            <context:exclude-filter type="regex" expression="com.chen.service.mockimpl.*"/>-->
            <!-- 排除真实实现类 -->
            <context:exclude-filter type="regex" expression="com.chen.service.impl.*"/>

             <!-- 排除注解Controller -->
          < context:exclude-filter type= "annotation" expression ="org.springframework.stereotype.Controller"/>
        </context:component-scan>
     
     
    Filter Type  Examples Expression  Description
    annotation  org.example.SomeAnnotation  符合SomeAnnoation的target class
    assignable  org.example.SomeClass  指定class或interface的全名
    aspectj  org.example..*Service+  AspectJ語法
    regex  org.example.Default.*  Regelar Expression
    custom org.example.MyTypeFilter  Spring3新增自訂Type,實作  org.springframework.core.type.TypeFilter
  • 相关阅读:
    算法第三章上机实践报告
    算法第3章作业
    算法第二章上机实验报告
    对二分法的理解和关于结对编程的看法
    轮播图终极版
    C语言II博客作业04
    C语言II博客作业03
    C语言II博客作业02
    C语言II博客作业01
    作业01
  • 原文地址:https://www.cnblogs.com/leonkobe/p/6473024.html
Copyright © 2011-2022 走看看