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


    <!-- 支持spring mvc新的注解类型 详细spring3.0手册 15.12.1 mvc:annotation-driven -->
	<mvc:annotation-driven>
	    <!-- 强化参数接收 -->
		<mvc:argument-resolvers>
			<bean class="org.durcframework.core.form.FormModelMethodArgumentResolver" />
		</mvc:argument-resolvers>
		 
        <mvc:message-converters>  
            <ref bean="fastJsonHttpMessageConverter" />
        </mvc:message-converters>
	</mvc:annotation-driven>
	
	<!-- 导入durcframework配置 -->
	<import resource="classpath*:/durcframework_spring/*.xml"/>

	<!-- 扫描controller 
		use-default-filters="false"只扫描@Controller
	-->
	<context:component-scan base-package="org.durcframework.autocode.controller"
		use-default-filters="false">
		<context:include-filter expression="org.springframework.stereotype.Controller"
			type="annotation" />
	</context:component-scan>
	
	
	<!-- 对模型视图名称的解析，即在模型视图名称添加前后缀,在requestmapping输入的地址后自动调用该类进行视图解析 -->
	<bean id="viewResolver"
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass"
			value="org.springframework.web.servlet.view.JstlView" />
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />
	</bean>
	
	<bean id="fastJsonHttpMessageConverter"  
        class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">  
  
        <property name="supportedMediaTypes">  
            <list>  
                <value>text/html;charset=UTF-8</value><!-- 避免IE出现下载JSON文件的情况 -->  
                <value>application/json;charset=UTF-8</value>
            </list>  
        </property>  
        <property name="features">
        	<list>
        		<!-- 格式化时间 -->
                <value>WriteDateUseDateFormat</value>  
        	</list>  
        </property>  
    </bean>  

</beans>
