<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans "> <mvc:annotation-driven /> <mvc:default-servlet-handler/> <!-- 3.配置jsp 显示ViewResolver --> <!--<bean>--> <!--<property value="org.springframework.web.servlet.view.JstlView" />--> <!--<property value="/WEB-INF/jsp/" />--> <!--<property value=".jsp" />--> <!--</bean>--> <!-- 4.扫描web相关的bean --> <context:component-scan base-package="controller" /> </beans>