package com.springboot.chapter3.config;

import com.springboot.chapter3.pojo.User;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/*@Configuration代表这是一个Java配置文件,Spring的容器会根据它来生成IoC容器去装配Bean*/
@Configuration
@ComponentScan("com.springboot.chapter3.*") //定义扫描的包
/*@ComponentScan(basePackages = {"com.springboot.chapter3.pojo"})定义扫描的包
  @ComponentScan(basePackages = {"com.springboot.chapter3.*"},excludeFilters = {@ComponentScan.Filter(classes =
        {Service.class})}) 定义扫描的包,并设置过滤条件
@ComponentScan(basePackageClasses = {User.class})定义扫描的类*/
public class AppConfig {

}

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2021-10-12
  • 2021-07-13
  • 2022-12-23
  • 2021-12-16
猜你喜欢
  • 2021-11-21
  • 2021-11-19
  • 2022-01-15
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2023-01-10
相关资源
相似解决方案