spring 和 springmvc的配置文件的问题
来源:5-14 spring、springmvc配置实操
 
			zengxianxue
2017-12-01
在 spring 和 springmvc的配置文件中,都配置扫描 com.mmall 包,.这样一个被注解标注的类不是会创建两个实例吗.?
1回答
- 
				
				你好,同学,这是一个非常好的问题。在二期的时候我们做了扫描包隔离,我把配置先给你发一下看看那 springmvc <context:component-scan base-package="com.mmall.controller" annotation-config="true" use-default-filters="false"> 
 <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
 </context:component-scan>spring <context:component-scan base-package="com.mmall" annotation-config="true"> 
 <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
 </context:component-scan>咱们二期上线啦,【二期进阶Tomcat集群和Redis分布式课程已经上线】 二期课程网址 http://coding.imooc.com/class/162.html 另外,看帖子看帖子看帖子,重要的说三遍哈 我给大家整理了这个,有问题可以来看看先找一下。 肯定有你想要的哈 部署环境的话 ,建议看下文章最后一小段哟~ 尽快进入咱们QQ群哟~~进群方法下面思维导图那个帖子有。非常详细 课程项目思维导图及线上环境、测试环境、部署linux和windows等解答 http://www.imooc.com/article/20193 【重点】问答区常见问题整理 http://www.imooc.com/article/18998 课程项目QQ群分享手记 http://www.imooc.com/article/19094 找工作的季节之简历及找工作的分享 http://www.imooc.com/article/19998 项目环境、vsftpd、linux、mysql等各种配置、软件下载 http://learning.happymmall.com 课程求10分好评哇谢谢啦~~(づ ̄ 3 ̄)づ 10
相似问题
