<?xml version="1.0" encoding="UTF-8"?>
<!-- - DispatcherServlet application context for Application's web tier. -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

	<!-- - The controllers are autodetected POJOs labeled with the @Controller annotation. -->
	<context:component-scan base-package="kcg">
		<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository" />
	</context:component-scan>

	<!-- Exception -->
	<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
		<property name="defaultErrorView" value="/error/bizError" />
		<property name="exceptionMappings">
			<props>
				<prop key="org.springframework.dao.DataAccessException">/error/dataAccessFailure</prop>
				<prop key="org.springframework.transaction.TransactionException">/error/transactionFailure</prop>
				<prop key="egovframework.rte.fdl.cmmn.exception.EgovBizException">/error/bizError</prop>
			</props>
		</property>
	</bean>
	<!-- /Exception -->

	<!-- View Resolver -->
	
	<!-- BeanName View -->
	<bean class="org.springframework.web.servlet.view.BeanNameViewResolver">
		<property name="order" value="0" />
	</bean>
		<!-- Excel View -->
	    <bean id="excelView" class="kcg.faics.cmmn.excel.ExcelView" />
	<!-- /BeanName View -->
	
	<!-- Tiles -->
	<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
		<property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView" />
		<property name="order" value="1" />
	</bean>

	<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
		<property name="definitions">
			<list>
				<value>/WEB-INF/config/tiles/*.xml</value>
			</list>
		</property>
	</bean>
	<!-- /Tiles -->
	
	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />
		<property name="order" value="2" />
	</bean>
	<!-- /View Resolver -->

	<!-- Json Response -->
	<bean id="objectMapper" class="kcg.faics.cmmn.json.CustomObjectMapper" />  
	<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" p:order="0" />    
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
        <property name="messageConverters">
	        <list>    
	            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
	                <property name="supportedMediaTypes">
	                    <list>
	                        <value>text/html;charset=UTF-8</value>
	                        <value>application/json;charset=UTF-8</value>
	                    </list>
	                </property>
	            </bean>            
	            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
	                <property name="objectMapper" ref="objectMapper"></property>                
	            </bean>
	        </list>
        </property>                        
    </bean>
    <!-- /Json Response -->
    
 	<!-- Aspect -->
    <aop:aspectj-autoproxy proxy-target-class="true"/>
	
</beans>