spring-mvc.xml配置

<context:annotation-config />

是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过package sanning的方式)上面的注解

<context:component-scan>   (参考文章1)

除了具有<context:annotation-config>的功能之外,<context:component-scan>还可以在指定的package下扫描以及注册javabean 

猜你喜欢

转载自www.cnblogs.com/yanliang12138/p/9714632.html