SpringMvc和Spring的父子容器关系

例如:

applicationContext-service中配置:

<!-- 扫描包加载Service实现类 -->

<context:component-scan base-package="com.taotao"></context:component-scan>

会扫描@Controller@Service@Repository@Compnent

SpringmvcXml中不扫描。

结论:springmvc。不能提供服务,因为springmvc子容器中没有controller对象。


相关文章:

  • 2021-09-05
  • 2021-08-04
  • 2021-06-12
  • 2021-05-15
  • 2021-11-14
  • 2021-06-20
  • 2022-01-15
猜你喜欢
  • 2021-09-20
  • 2021-12-11
  • 2021-10-24
  • 2022-01-08
  • 2022-01-12
相关资源
相似解决方案