<?xml version="1.0" encoding="UTF-8" ?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd"
>
<!--在springmvc开启注解驱动 只在controller层使用springmvc注解-->
<mvc:annotation-driven/>
<!--开启springmvc的扫描 在哪层使用就的扫描该层的包路径-->
<!--在spring的配置文件是 扫描的根路径
这就会产生重复加载
就得在spring配置文件中排除springmvc扫描的controller
-->
<context:component-scan base-package="com.itheima.controller"/>
</beans>
06-09
1315
12-08
2354