<?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:cache="http://www.springframework.org/schema/cache"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	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.2.xsd
        http://www.springframework.org/schema/util
       http://www.springframework.org/schema/util/spring-util-4.2.xsd
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-4.2.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
       http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.2.xsd
       http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <mvc:annotation-driven/>
	<!-- 扫描包 -->
	<context:component-scan base-package="com.lion.*">
		<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
	</context:component-scan>
	<!-- 转换器 -->
	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
		<property name="webBindingInitializer">
			<bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer">
				<property name="conversionService">
					<bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean"></bean>
				</property>
			</bean>
		</property>
		<property name="messageConverters">
			<list>
				<ref bean="string_hmc" />
				<ref bean="resource_hmc" />
				<ref bean="source_hmc" />
				<ref bean="jackson_hmc" />
			</list>
		</property>
	</bean>
	<bean id="string_hmc" class="org.springframework.http.converter.StringHttpMessageConverter" >
		<property name="supportedMediaTypes">
            <list>
                 <value>text/plain;charset=UTF-8</value>
            </list>
        </property>
	</bean>
	<bean id="resource_hmc" class="org.springframework.http.converter.ResourceHttpMessageConverter" />
	<bean id="source_hmc" class="org.springframework.http.converter.xml.SourceHttpMessageConverter" />
	<bean id="jackson_hmc" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" >
		<property name="supportedMediaTypes">
            <list>
                 <value>application/json;charset=UTF-8</value>
            </list>
        </property>
	</bean><!-- 处理json -->
	<!-- 读取配置文件 -->
	<bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
          <property name="locations">
              <list>
                  <value>classpath:/config.properties</value>
              </list>
          </property>
    </bean>
	 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
          <property name="properties" ref="configProperties" />
     </bean>
	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
          <property name="maxUploadSize"><value>80000000</value></property>
          <property name="defaultEncoding"><value>UTF-8</value></property>
          <property name="uploadTempDir"><value>fileUpload</value></property>
          <property name="maxInMemorySize" value="4096"/>
    </bean>
</beans>