springmvc-servlet.xml配置文件

springmvc-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:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="cn.kgc.controller"/>

    <!--使用SpringMVC中的注解-->
    <mvc:annotation-driven/>
    <!--设置指定的目录为静态资源(能被web服务器加载的)-->
    <mvc:resources mapping="/statics/**" location="/statics/" />
    <!-- 完成视图的对应 只处理jsp视图 -->
    <!-- 对转向页面的路径解析。prefix:前缀, suffix:后缀 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize" value="500000000"/>
        <property name="defaultEncoding" value="utf-8"/>
    </bean>
    <!-- 配置interceptors -->
    <!--<mvc:interceptors>-->
        <!--<mvc:interceptor>-->
            <!--&lt;!&ndash;<mvc:mapping path="/devLogin/*"/>&ndash;&gt;-->
            <!--<mvc:mapping path="/*"/>-->
            <!--<bean class="cn.kgc.interceptor.HandlerInterceptor1"/>-->
        <!--</mvc:interceptor>-->

    <!--</mvc:interceptors>-->

</beans>   

猜你喜欢

转载自blog.csdn.net/s20180412/article/details/82834412