用alt+7可以查看各个接口的底层方法名
表现层→日志层
↓
业务层 (ApplicationContext)
↓
数据层
IoC容器
表现层bean 业务层bean 数据层bean 远程服务bean ...
@ComponentScan( value="com.thenema", excludeFilters = @ComponentScan.Filter( type = FilterType.ANNOTATION, classes = Repository.class) }
includeFilters:设置包含性过滤器
excludeFilters:设置排除性过滤器
type:设置过滤器类型
public class MyTypeFilter implements TypeFilter{ public boolean match(MetadataReader mr,MetadataReaderFactory mrf) throws IOException{ ClassMetadata cm = metadataReader.getClassMetadata(); String className =cm.getClassName(); if(className.equals("com.thenema.dao.impl.BookDaoImpl")){ return true; } return false; } }