spring-web.xml 6.42 KB
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd

    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
       default-autowire="byName">



	<mvc:annotation-driven >
		
		<mvc:argument-resolvers>
			<bean class="com.diligrp.website.util.web.resolver.BeanArgumentResolver" />
		</mvc:argument-resolvers>
		
		<mvc:message-converters register-defaults="true">  
			<!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->  
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">  
                <constructor-arg value="UTF-8" />  
            </bean>
            <!-- 将Jackson2HttpMessageConverter的默认格式化输出设为true -->  
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">  
                <property name="prettyPrint" value="true"/>  
            </bean>
		</mvc:message-converters>
		
	</mvc:annotation-driven>

	<!-- <mvc:resources mapping="/swagger/**" location="/WEB-INF/swagger/"/>-->

	<!-- 视图解析器配置 -->
	<bean id="velocityConfigurer"
		class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
		<property name="resourceLoaderPath" value="/WEB-INF/views/" />
		<property name="configLocation" value="classpath:velocity.properties" />
	</bean>
	<bean id="viewResolver"
		class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
		<property name="suffix" value=".vm" />
		<property name="contentType" value="text/html;charset=UTF-8" />
	</bean>

	<!-- 文件上传 -->
	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<property name="defaultEncoding" value="UTF-8" />
	</bean>

    <bean id="velocityDefaultLayout" class="java.lang.String">
        <constructor-arg value="${project.view.VMDefault}" />
    </bean>
	<!--<bean id="webUtils" class="com.diligrp.mobsite.getway.web.utils.WebUtils">
		<property name="assetsPath" value="${project.default.assets.path}" />
		<property name="commonAssetsPath" value="${project.default.assets.common.path}" />
		<property name="localPath" value="${project.default.local.path}" />
		<property name="productPath" value="${project.product.detail.path}" />
		<property name="shopDomain" value="${project.shop.domain}" />
	</bean>

	
	<bean id="dateFormatUtils" class="com.diligrp.website.util.format.DateFormatUtils" />
	<bean id="moneyUtils" class="com.diligrp.website.util.format.MoneyUtils" />
	-->

	<bean id="velocityTools" class="java.util.HashMap">
		<!--<constructor-arg>
			<map>
				<entry key="moneyUtils" value-ref="moneyUtils" />
				<entry key="webUtils" value-ref="webUtils" />
				<entry key="dateFormatUtils" value-ref="dateFormatUtils" />
			</map>
		</constructor-arg>-->
	</bean>
	
	<mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/mobsiteApp/**"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/buyerLogin"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/buyerLogins"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/sendAuthCode"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/checkAuthCode"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegister"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegisters"/>
			<mvc:exclude-mapping path="/mobsiteApp/user/loginForAuth"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/modifyPwd"/>

			<mvc:exclude-mapping path="/mobsiteApp/goods/getProductByCid"/>
			<mvc:exclude-mapping path="/mobsiteApp/goods/getProductCategory"/>
			<mvc:exclude-mapping path="/mobsiteApp/goods/getProductIntroduction"/>
			<mvc:exclude-mapping path="/mobsiteApp/goods/searchGoodList"/>
			<mvc:exclude-mapping path="/mobsiteApp/meal/getMealList"/>
			<mvc:exclude-mapping path="/mobsiteApp/meal/getMealById"/>
			<mvc:exclude-mapping path="/mobsiteApp/shop/getProductRecommend"/>
			<mvc:exclude-mapping path="/mobsiteApp/topic/getHomeStatisticsTopic"/>
			<mvc:exclude-mapping path="/mobsiteApp/topic/getPicInfo"/>
			<mvc:exclude-mapping path="/mobsiteApp/common/getAllCountryTree"/>
			<mvc:exclude-mapping path="/mobsiteApp/common/getCity"/>
			<mvc:exclude-mapping path="/mobsiteApp/common/getCitys"/>
			<mvc:exclude-mapping path="/mobsiteApp/common/getCountry"/>
			<mvc:exclude-mapping path="/mobsiteApp/common/uploadImg"/>

			<!--卖家-->

			<mvc:exclude-mapping path="/mobsiteApp/seller/user/sellerLogin"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/sellerLogins"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/sendAuthCode"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/checkAuthCode"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/checkMobile"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/sellerRegister"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/sellerRegisters"/>
			<mvc:exclude-mapping path="/mobsiteApp/seller/user/modifyPwd"/>
             <bean class="com.diligrp.mobsite.getway.web.filter.LoginTimeoutInterceptor"/>
        </mvc:interceptor>
 <!--       <mvc:interceptor>
            <mvc:mapping path="/mobsiteApp/**"/>
            <mvc:exclude-mapping path="/swagger/**"/>
            <mvc:exclude-mapping path="/swagger-ui.html"/>
            <mvc:exclude-mapping path="/swagger-resources/**"/>
            <mvc:exclude-mapping path="/webjars/**"/>
            <mvc:exclude-mapping path="/api-docs/**"/>
            <mvc:exclude-mapping path="/v2/api-docs/**"/>
            <mvc:exclude-mapping path="/mobsiteApp/supply/uploadMessagePic"/>
            <mvc:exclude-mapping path="/mobsiteApp/user/uploadAuthImage"/>
            &lt;!&ndash; 上传文件 &ndash;&gt;
            <mvc:exclude-mapping path="/mobsiteApp/common/uploadImg"/>
            <mvc:exclude-mapping path="/mobsiteApp/common/uploadAudio"/>
            <mvc:exclude-mapping path="/mobsiteApp/common/uploadImgFullUrl"/>
            <mvc:exclude-mapping path="/mobsiteApp/version/**"/>
            <mvc:exclude-mapping path="/mobsiteApp/topic/getPicInfo"/>

            <bean class="com.diligrp.mobsite.getway.web.filter.TokenInterceptor" />
        </mvc:interceptor>-->
        


    </mvc:interceptors>
	
</beans>