<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd ">
<!-- 启动扫描所有的controller -->
<context:component-scan base-package="com"/>
<mvc:annotation-driven />
<!--注解说明 -->
<context:annotation-config />
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 请求映射 -->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
<!-- 静态资源配置 -->
<mvc:default-servlet-handler />
<!-- 用户拦截器配置 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**" />
<bean class="com.intercepter" />
</mvc:interceptor>
</mvc:interceptors>
</beans>
spring *-servlet.xml
最新推荐文章于 2021-12-02 22:14:30 发布