<?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-4.3.xsd
						http://www.springframework.org/schema/context
						http://www.springframework.org/schema/context/spring-context-4.3.xsd
						http://www.springframework.org/schema/mvc
						http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">

    <!-- 扫描包 -->
    <context:component-scan base-package="com.zhaxd.web.controller" />
    <!-- 上传文件配置 -->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="defaultEncoding" value="utf-8" />
        <property name="maxUploadSize" value="1024000000"/>
        <property name="maxInMemorySize" value="4096"/>
    </bean>
    <!-- 下载文件配置 -->
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> 
   		<property name="messageConverters"> 
    		<list>
     			<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter" /> 
   				<ref bean="stringHttpMessageConverter" /> 
			</list> 
		</property>
	 </bean>
	 <bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter">
	 	<property name="supportedMediaTypes"> 
	 		<list> 
	 			<value>text/plain;charset=UTF-8</value>
		 	</list>
 		</property>
	</bean>
    <!-- 视图解析器 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views/" />
        <property name="suffix" value=".jsp" />
    </bean>
    <!-- 默认配置 -->
    <mvc:annotation-driven>
    	<mvc:message-converters>
			<bean class="com.zhaxd.core.conf.UTF8StringHttpMessageConverter" />
		</mvc:message-converters>
    </mvc:annotation-driven>
    <!-- 拦截器配置 -->
	<mvc:interceptors>
		<mvc:interceptor>
			<mvc:mapping path="/**"/>
			<bean class="com.zhaxd.core.conf.LoginInterceptor"/>
		</mvc:interceptor>
	</mvc:interceptors>
</beans>
