1,@ServletComponentScan

在SpringBoot的main方法上使用@ServletComponentScan注解后,Servlet、Filter、Listener可以直接通过@WebServlet、@WebFilter、@WebListener注解自动注册,无需其他代码。

2,@ComponentScan

 

包扫描会扫描只要标注了@Controller,@Service,@Repository,@Component这四个注解都会被扫描到容器中。

 

3,@Configurati

说明这是个配置文件,和原来xml配置是等效的,只不过现在用java代码进行配置了 加上一个@Configuration注解就行了

 

on

 

相关文章:

  • 2021-12-02
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
猜你喜欢
  • 2021-10-03
  • 2021-12-19
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2021-05-01
  • 2022-12-23
相关资源
相似解决方案