<?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:task="http://www.springframework.org/schema/task"
       xsi:schemaLocation="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.xsd
       http://www.springframework.org/schema/mvc 
       http://www.springframework.org/schema/mvc/spring-mvc.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop.xsd
       http://www.springframework.org/schema/task
       http://www.springframework.org/schema/task/spring-task.xsd">
    <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>
    <task:annotation-driven />
    <mvc:annotation-driven/>
    <context:component-scan base-package="com.manage.controller,com.manage.annotation"/>
    <aop:aspectj-autoproxy proxy-target-class="true" />
    <aop:config proxy-target-class="true"/>
    <!-- 静态资源映射 -->
   <!-- <mvc:resources mapping="/static/**" location="/static/" />-->
    <!-- 当上面要访问的静态资源不包括在上面的配置中时，则根据此配置来访问 -->
    <!--<mvc:default-servlet-handler />-->
    <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="exceptionMappings">
            <props>
                <prop key="com.manage.controller.PermissionsException">redirect:/refuse</prop>
            </props>
        </property>
    </bean>
    <!--配置视图解析器，方便页面返回  -->
    <bean id="jspViewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views/" />
        <property name="suffix" value=".jsp" />
    </bean>

    <!-- 两个标准配置 -->
    <!-- 将springmvc不能处理的请求交tomcat -->
    <mvc:default-servlet-handler/>

    <!-- 支持springmvc更高级的一些功能，JSR303校验,快捷的ajax...映射动态请求 -->
    <!-- 2019-4-18 ljx -->
    <mvc:annotation-driven>
        <mvc:message-converters>
            <bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
        </mvc:message-converters>

    </mvc:annotation-driven>

    <!-- 登录拦截器 -->
    <!-- 2019-4-16 ljx -->
    <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <mvc:exclude-mapping path="/static/**"/>
            <bean class="com.manage.interceptor.LoginInterceptor"/>
        </mvc:interceptor>
    </mvc:interceptors>
   <!-- <bean id="multipartResolver"
          class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize" value="104857600" />
        <property name="maxInMemorySize" value="4096" />
    </bean>-->
</beans>