applicationContext.xml将Controller的注解打消掉
<context:component-scan base-package="com.steven"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan>
applicationContext-MVC.xml将Service注解给去掉
<context:component-scan base-package="com.steven"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" /> </context:component-scan>
转载:http://blog.csdn.net/liuwenbo0920/article/details/7260013