配置:spring-mvc.xml配置

<context:annotation-config />

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

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

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

参考:http://www.cnblogs.com/doudouxiaoye/p/5681518.html

 

posted @ 2018-09-27 17:56  弱水三千12138  阅读(132)  评论(0编辑  收藏  举报