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
  • 相关阅读:
    《TD项目开发小结》
    感悟
    毕业两年了
    ip+port无法访问nginx问题
    问题解决之道
    调休9天的那些日子
    关于类加载器(ClassLoader)
    ios核心蓝牙之心率监控(swift)
    git(git-flow)的高效管理使用
    WKWebview加载本地图片时出现路径问题
  • 原文地址:https://www.cnblogs.com/leonkobe/p/6473024.html
Copyright © 2011-2022 走看看