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

	<bean id="jsonViewResolver"
		class="org.springframework.web.servlet.view.BeanNameViewResolver">
		<property name="order" value="1"></property>
	</bean>

	<bean
		class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"
		id="jsonView">
		<property name="contentType"
			value="application/json;charset=UTF-8"></property>
		<property name="objectMapper">
			<ref bean="elinkObjectMapper" />
		</property>
	</bean>

	<bean class="com.eactive.eai.rms.common.excel.NewExcelView"
		id="excelView"></bean>

	<bean id="internalViewResolver"
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass"
			value="org.springframework.web.servlet.view.JstlView"></property>
		<property name="suffix" value=".jsp"></property>
		<property name="prefix" value="/jsp/"></property>
		<property name="order" value="2"></property>
	</bean>

	<bean id="multipartResolver"
		class="org.springframework.web.multipart.support.StandardServletMultipartResolver">
	</bean>

	<bean id="exceptionResolver"
		class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
	</bean>

	<mvc:annotation-driven
		conversion-service="conversionService"
		ignore-default-model-on-redirect="false">
		<mvc:argument-resolvers>
			<ref bean="sortResolver" />
			<ref bean="pageableResolver" />
		</mvc:argument-resolvers>
	</mvc:annotation-driven>

	<bean id="sortResolver"
		class="org.springframework.data.web.SortHandlerMethodArgumentResolver"></bean>

	<bean id="pageableResolver"
		class="org.springframework.data.web.PageableHandlerMethodArgumentResolver">
		<constructor-arg ref="sortResolver"></constructor-arg>
		<property name="oneIndexedParameters" value="true"></property>
		<property name="pageParameterName" value="page"></property>
		<property name="sizeParameterName" value="rows"></property>
	</bean>

	<context:component-scan
		base-package="com.eactive.eai.rms">
		<context:include-filter type="annotation"
			expression="org.springframework.stereotype.Controller" />
		<context:exclude-filter type="aspectj"
			expression="!com.eactive.eai.rms..*Controller" />
	</context:component-scan>
	<mvc:interceptors>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean
				class="com.eactive.eai.rms.common.interceptor.RequestParameterLoggingInterceptor" />
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean
				class="com.eactive.eai.rms.common.interceptor.DataSourceTypeInterceptor" />
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<mvc:exclude-mapping path="/loginForm.do" />
			<mvc:exclude-mapping path="/_onl/**" />
			<bean
				class="com.eactive.eai.rms.common.interceptor.SessionCheckInterceptor" />
		</mvc:interceptor>
 		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<mvc:exclude-mapping path="/_onl/**" />
			<bean class="com.eactive.eai.rms.common.interceptor.AuthorizeInterceptor" />
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/_onl/**"/>
			<bean class="com.eactive.eai.rms.common.interceptor.ApiKeyInterceptor" />
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean
				class="com.eactive.eai.rms.common.interceptor.MenuInterceptor" />
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean id="localeChangeInterceptor"
				class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
				<property name="paramName" value="lang" />
			</bean>
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<ref bean="auditLogInterceptor"/>
		</mvc:interceptor>
		<!-- <mvc:interceptor> <mvc:mapping path="/**"/> <bean class="com.eactive.eai.rms.common.interceptor.dynamicLog.DynamicLogInterceptor"/>
			</mvc:interceptor> -->
	</mvc:interceptors>

	<bean id="viewNameTranslator"
		class="org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator">
	</bean>

	<bean id="urlFilenameViewController"
		class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
	</bean>
	<context:annotation-config />

	<aop:aspectj-autoproxy />

</beans>
