<?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"
       xmlns:cache="http://www.springframework.org/schema/cache"
       xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd 
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-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/cache  
    http://www.springframework.org/schema/cache/spring-cache-3.2.xsd  ">
    <bean id="SystemLogAspect" class="com.dubh.syslog.annotation.SystemLogAspect"></bean>
    <context:annotation-config />

    <!-- 注解扫描包 -->
    <!-- <context:component-scan base-package="com.taiyiche.goldkey" /> -->
    <context:component-scan base-package="com.zhongdao.jlr">
        <context:include-filter type="annotation"
                                expression="org.springframework.stereotype.Controller" />
    </context:component-scan>
    <!-- 通知spring使用cglib而不是jdk的来生成代理方法 AOP可以拦截到Controller -->
    <!-- <aop:aspectj-autoproxy proxy-target-class="true" /> -->
    <!-- 开启注解 -->
    <mvc:annotation-driven />

    <!-- 静态资源(js/image)的访问 -->
    <mvc:resources location="/js/" mapping="/js/**" />
    <mvc:resources location="/css/" mapping="/css/**" />
    <mvc:resources location="/images/" mapping="/images/**" />
    <mvc:resources location="/img/" mapping="/img/**" />
    <!--<mvc:resources location="/kindeditor/" mapping="/kindeditor/**" />-->
    <mvc:resources location="/page/" mapping="/page/**" />
    <mvc:resources location="/files/" mapping="/files/**" />
    <mvc:resources location="/" mapping="/*" />

    <!-- 避免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>

    <!-- 定义视图解析器 -->
    <bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="contentType" value="text/html;charset=utf-8" />
        <property name="cache" value="true" />
        <property name="prefix" value="/" />
        <property name="suffix" value=".jsp"></property>
    </bean>
    <!-- 附件设置 -->
    <bean id="multipartResolver"
          class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="defaultEncoding" value="utf-8"></property>
        <property name="maxUploadSize" value="10485760000"></property>
        <property name="maxInMemorySize" value="40960"></property>
    </bean>
	<!-- 登录拦截器 -->  
	<mvc:interceptors>   
	  <mvc:interceptor>   
	     <mvc:mapping path="/**" /> 
	    <mvc:exclude-mapping path="/base/login.do"/>  
	    <bean class="com.zhongdao.jlr.business.interceptor.UserInterceptor"></bean>   
	  </mvc:interceptor>   
	</mvc:interceptors>  
</beans>
