1. <?xml version="1.0" encoding="UTF-8"?>
    2. <beans xmlns="http://www.springframework.org/schema/beans"
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4. xmlns:context="http://www.springframework.org/schema/context"
    5. xmlns:mvc="http://www.springframework.org/schema/mvc"
    6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd">
    7. <!--添加包扫描-->
    8. <context:component-scan base-package="com.chentianyu.controller" />
    9. <!--添加mvc注解驱动-->
    10. <mvc:default-servlet-handler />
    11. <mvc:annotation-driven />
    12. <!--因为本项目全都是ajax请求,不需要配置视图解析器-->
    13. </beans>