<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       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"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd 
http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    <!-- 自动扫描controller包下的所有类，使其认为spring mvc的控制器 -->
    <context:component-scan
            base-package="com.fuxi.ws.web.controller"/>

    <mvc:resources mapping="/image/**" location="/image/"
                   cache-period="86400"/>
    <mvc:resources mapping="/css/**" location="/css/"/>
    <mvc:resources mapping="/chatimg/**" location="/chatimg/"/>
    <mvc:resources mapping="/js/**" location="/js/"/>
    <mvc:resources mapping="/doc/**" location="/doc/"/>
    <mvc:resources mapping="/*.html" location="/"/>
    <mvc:annotation-driven/>
    <!-- 拦截器 -->
    <mvc:interceptors>
        <!-- 多个拦截器,顺序执行 -->
        <mvc:interceptor>
            <mvc:mapping path="/mall.html"/>
            <mvc:mapping path="/mall.do"/>
            <mvc:mapping path="/vip.*"/>
            <mvc:mapping path="/mall/login.*"/>
            <mvc:mapping path="/mallgoods/category.*"/>
            <mvc:mapping path="/mallgoods/*/goodslist.*"/>
            <mvc:mapping path="/mallgoods/*/new_hot.*"/>
            <mvc:mapping path="/mallgoods/*/goodsdetail.*"/>
            <mvc:mapping path="/mall/microPage.*"/>
            <mvc:mapping path="/mall/shops.*"/>
            <mvc:mapping path="/mallseckill/seckillpage.*"/>
            <mvc:mapping path="/mallseckill/*/goodsdetail.*"/>
            <mvc:mapping path="/return/returndtl.*"/>
            <mvc:mapping path="/inviter.*"/>
            <bean class="com.fuxi.ws.system.AutoLoginFilter"></bean>
        </mvc:interceptor>
        <mvc:interceptor>
            <mvc:mapping path="/mall.html"/>
            <mvc:mapping path="/mall.do"/>
            <mvc:mapping path="/mallgoods/*/goodsdetail.*"/>
            <mvc:mapping path="/mallgoods/*/goodslist.*"/>
            <mvc:mapping path="/mallgoods/category.*"/>
            <mvc:mapping path="/mallgoods/*/new_hot.*"/>
            <mvc:mapping path="/mall/microPage.*"/>
            <mvc:mapping path="/mall/shops.*"/>
            <mvc:exclude-mapping path="/guidecenter/*"/>
            <bean class="com.fuxi.ws.system.AllowRegistrationFilter"></bean>
        </mvc:interceptor>
        <mvc:interceptor>
            <mvc:mapping path="/vip.*"/>
            <mvc:mapping path="/vip/**"/>
            <mvc:mapping path="/VIPConsignee/*"/>
            <mvc:mapping path="/posSales/*"/>
            <mvc:mapping path="/fitting/*"/>
            <mvc:mapping path="/vipmessage/*"/>
            <mvc:mapping path="/fxcontroller/savefx.*"/>
            <mvc:mapping path="/fxcontroller/gofx.*"/>
            <mvc:mapping path="/fxcontroller/showwdsr.*"/>
            <mvc:mapping path="/fxcontroller/shopallload.*"/>
            <mvc:mapping path="/fxcontroller/teamallload.*"/>
            <mvc:mapping path="/fxcontroller/shopmonthload.*"/>
            <mvc:mapping path="/fxcontroller/teammonthload.*"/>
            <mvc:mapping path="/fxcontroller/applydistribution.*"/>
            <mvc:mapping path="/order/*"/>
            <mvc:mapping path="/wallet/*"/>
            <mvc:mapping path="/fcart/*"/>
            <mvc:mapping path="/vipticket/*"/>
            <mvc:mapping path="/cart/*"/>
            <mvc:mapping path="/cart.*"/>
            <mvc:mapping path="/return/*"/>
            <mvc:mapping path="/mallgoods/*"/>
            <mvc:mapping path="/mallgoods/**"/>
            <mvc:mapping path="/marketing/*"/>
            <mvc:mapping path="/marketing/**"/>
            <mvc:mapping path="/promotions/*"/>
            <mvc:mapping path="/repair/*"/>
            <mvc:mapping path="/mquestion/*"/>
            <mvc:mapping path="/quantitybody/*"/>
            <mvc:mapping path="/chat/*"/>
            <mvc:mapping path="/mallseckill/*"/>
            <mvc:mapping path="/mallseckill/**"/>
            <mvc:mapping path="/vipgift/*"/>
            <mvc:mapping path="/giftcard/*"/>
            <mvc:exclude-mapping path="/mallgoods/category.*"/>
            <mvc:exclude-mapping path="/mallgoods/viewposter.*"/>
            <mvc:exclude-mapping path="/mallgoods/loadingGoodsDtlImg.*"/>
            <mvc:exclude-mapping path="/mallgoods/loadingGoods.*"/>
            <mvc:exclude-mapping path="/mallgoods/zan.*"/>
            <mvc:exclude-mapping path="/mallgoods/share.*"/>
            <mvc:exclude-mapping path="/mallgoods/collect.*"/>
            <mvc:exclude-mapping path="/mallgoods/*/new_hot.*"/>
            <mvc:exclude-mapping path="/mallgoods/*/goodslist.*"/>
            <mvc:exclude-mapping path="/mallgoods/**/goodslist_loading.*"/>
            <mvc:exclude-mapping path="/mallgoods/*/goodsdetail.*"/>
            <mvc:exclude-mapping path="/mallgoods/**/saveToCart.*"/>
            <mvc:exclude-mapping path="/vipticket/getTicket.*"/>
            <mvc:exclude-mapping path="/order/checkTakeQRCode.*"/>
            <mvc:exclude-mapping path="/order/takeQRCode.*"/>
            <mvc:exclude-mapping path="/vipmessage/viewmessage.*"/>
            <mvc:exclude-mapping path="/vipmessage/viewmsgdata.*"/>
            <mvc:exclude-mapping path="/mallseckill/seckill.*"/>
            <mvc:exclude-mapping path="/marketing/*/rotary.*"/>
            <mvc:exclude-mapping path="/marketing/*/luckypreview.*"/>
            <mvc:exclude-mapping path="/mquestion/questionnaire.*"/>
            <mvc:exclude-mapping path="/fitting/guidfitting.*"/>
            <mvc:exclude-mapping path="/fitting/guidfittingdtl.*"/>
            <mvc:exclude-mapping path="/fitting/fittingdata.*"/>
            <mvc:exclude-mapping path="/fitting/handlefit.*"/>
            <mvc:exclude-mapping path="/vip/barcode.*"/>
            <mvc:exclude-mapping path="/vip/qrcode.*"/>
            <mvc:exclude-mapping path="/giftcard/card.*"/>
            <mvc:exclude-mapping path="/mallseckill/seckillpage.*"/>
            <mvc:exclude-mapping path="/inviter/receive.*"/>
            <bean class="com.fuxi.ws.system.VIPFilter"></bean>
        </mvc:interceptor>
        <mvc:interceptor>
            <mvc:mapping path="/sales/*"/>
            <mvc:mapping path="/transfer/*"/>
            <mvc:mapping path="/guidecenter/consultation.*"/>
            <mvc:mapping path="/guidecenter/performance.*"/>
            <mvc:mapping path="/guidecenter/masssend.*"/>
            <mvc:mapping path="/guidecenter/clientinfo.*"/>
            <mvc:mapping path="/guidecenter/performances.*"/>
            <mvc:mapping path="/guidecenter/performancesDetail.*"/>
            <mvc:mapping path="/guidecenter/guidevips.*"/>
            <mvc:mapping path="/salescenter/vipmanage.*"/>
            <mvc:mapping path="/salescenter/labelinvip.*"/>
            <mvc:mapping path="/salescenter/sendmessage.*"/>
            <mvc:mapping path="/salescenter/vipdetail.*"/>
            <mvc:mapping path="/salescenter/salesrank.*"/>
            <mvc:mapping path="/salescenter/vipphotos.*"/>
            <mvc:mapping path="/salescenter/choicemanagement.*"/>
            <mvc:mapping path="/salescenter/givecoupon.*"/>
            <mvc:mapping path="/salescenter/verificationcoupon.*"/>
            <mvc:mapping path="/salescenter/couponinfo.*"/>
            <mvc:mapping path="/salescenter/giftcardmanagement.*"/>
            <mvc:mapping path="/salescenter/giftcardsalesdtl.*"/>
            <mvc:mapping path="/salescenter/cardsales.*"/>
            <mvc:mapping path="/salescenter/choosevip.*"/>
            <mvc:mapping path="/fitting/guidfitting.*"/>
            <mvc:mapping path="/fitting/guidfittingdtl.*"/>
            <mvc:mapping path="/gorder/*"/>
            <mvc:mapping path="/facepass/snapList.*"/>
            <mvc:mapping path="/facepass/snapBindVip.*"/>
            <mvc:exclude-mapping path="/sales/login.*"/>
            <mvc:exclude-mapping path="/sales/getcaptcha.*"/>
            <mvc:exclude-mapping path="/transfer/getcaptcha.*"/>
            <mvc:exclude-mapping path="/sales/logincheck.*"/>
            <mvc:exclude-mapping path="/sales/goodsdetail.*"/>
            <mvc:exclude-mapping path="/sales/sendcaptcha.*"/>
            <mvc:exclude-mapping path="/transfer/goodsdetail.*"/>
            <mvc:exclude-mapping path="/transfer/sendcaptcha.*"/>
            <mvc:exclude-mapping path="/sales/checkcaptcha.*"/>
            <mvc:exclude-mapping path="/transfer/checkcaptcha.*"/>
            <mvc:exclude-mapping path="/sales/*/alipay.*"/>
            <mvc:exclude-mapping path="/gorder/logistics.*"/>
            <mvc:exclude-mapping path="/gorder/checkNo.*"/>
            <mvc:exclude-mapping path="/gorder/sendGoods.*"/>
            <mvc:exclude-mapping
                    path="/salescenter/*/*/giftcardqrcode.*"/>
            <mvc:exclude-mapping path="/salescenter/qrcode.*"/>
            <mvc:exclude-mapping
                    path="/salescenter/wxpayqrcode.*"/>
            <mvc:exclude-mapping
                    path="/salescenter/alipayqrcode.*"/>
            <mvc:exclude-mapping
                    path="/salescenter/*/alipay.*"/>
            <mvc:exclude-mapping
                    path="/salescenter/goodspage.*"/>
            <mvc:exclude-mapping
                    path="/salescenter/chat_text.*"/>

            <bean class="com.fuxi.ws.system.EmployeeFilter"></bean>
        </mvc:interceptor>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <bean class="com.fuxi.ws.system.PVFilter"></bean>
        </mvc:interceptor>
        <mvc:interceptor>
            <mvc:mapping path="/returnorder/*"/>
            <mvc:mapping path="/goods/*"/>
            <mvc:mapping path="/shop/*"/>
            <mvc:mapping path="/Config/*"/>
            <mvc:mapping path="/wmap/*"/>
            <mvc:mapping path="/wgoodstype/*"/>
            <mvc:mapping path="/color/*"/>
            <mvc:mapping path="/employee/*"/>
            <mvc:mapping path="/vipmanager/*"/>
            <mvc:mapping path="/eshoporder/*"/>
            <mvc:mapping path="/delivery/*"/>
            <mvc:mapping path="/management/*"/>
            <mvc:mapping path="/FileUpload/*"/>
            <mvc:mapping path="/distribute/*"/>
            <mvc:mapping path="/wTicket/*"/>
            <mvc:mapping path="/right/*"/>
            <mvc:mapping path="/user/*"/>
            <mvc:mapping path="/promotion/*"/>
            <mvc:mapping path="/repairmanage/*"/>
            <mvc:mapping path="/marketingorder/*"/>
            <mvc:mapping path="/size/*"/>
            <mvc:mapping path="/autoreply/*"/>
            <mvc:mapping path="/tag/*"/>
            <mvc:mapping path="/qy/visitorback.*"/>
            <mvc:mapping path="/supplier/*"/>
            <mvc:mapping path="/goodstype/*"/>
            <mvc:exclude-mapping
                    path="/wTicket/gogetticket.*"/>
            <mvc:exclude-mapping path="/autorunset/*"/>
            <mvc:exclude-mapping path="/giftcardmanage/*"/>
            <bean class="com.fuxi.ws.system.Filter"></bean>
        </mvc:interceptor>
    </mvc:interceptors>
    <!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
    <bean id="mappingJacksonHttpMessageConverter"
          class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
        <property name="supportedMediaTypes">
            <list>
                <value>text/html;charset=UTF-8</value>
            </list>
        </property>
    </bean>

    <!-- 启动Spring MVC的注解功能，完成请求和注解POJO的映射 -->
    <bean
            class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
        <property name="messageConverters">
            <list>
                <ref bean="mappingJacksonHttpMessageConverter"/><!-- json转换器 -->
            </list>
        </property>
    </bean>

    <!-- 对模型视图名称的解析，即在模型视图名称添加前后缀 -->
    <bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver"
            p:prefix="/WEB-INF/jsp/" p:suffix=".jsp"/>

    <bean id="multipartResolver"
          class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="defaultEncoding">
            <value>UTF-8</value>
        </property>
        <property name="maxUploadSize">
            <value>209715200</value><!--上传文件大小限制为200M，31*1024*1024 -->
        </property>
        <property name="maxInMemorySize">
            <value>4096</value>
        </property>
    </bean>
    <!-- <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
        <property name="order" value="0" /> <property name="pathMatcher"> <bean class="com.fuxi.ws.system.CaseInsensitiveAntPathMatcher"
        /> </property> </bean> -->
    <bean name="caseInsensitivePathMatcher"
          class="com.fuxi.ws.system.CaseInsensitiveAntPathMatcher"/>
    <bean name="handlerMapping"
          class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
        <property name="pathMatcher" ref="caseInsensitivePathMatcher"></property>
    </bean>
</beans>