
dispatcherServlet-Servlet.xml
<?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 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"><!--SpringMVC--><!--扫描实例组件--><context:component-scan base-package="com.wzy" use-default-filters="false"><!--use-default-filters="false"禁用默认规则--><context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/><!--只扫描controller--></context:component-scan><!--配置视图解析器,跳转页面的前后缀--><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/views/"/><property name="suffix" value=".jsp"/></bean><!--两个标准配置--><!--将springmvc不能处理的请求交给tomcat--><mvc:default-servlet-handler/><!--能支持springmvc更高级的一些功能,JSP303校验、快捷的ajax、映射的动态请求--><mvc:annotation-driven/></beans>
