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

    <!-- 패키지 내 Controller, Service, Repository 클래스의 auto detect를 위한 mvc 설정 -->
    <context:component-scan base-package="egovframework, itn">
    <!-- <context:component-scan base-package="itn"> -->
       <!--  <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에 대한 오류 페이지를 연결하는 mvc 설정 -->
    <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="defaultErrorView" value="cmm/error/egovError"/>
        <property name="exceptionMappings">
            <props>
                <prop key="org.springframework.dao.DataAccessException">cmm/error/dataAccessFailure</prop>
                <prop key="org.springframework.transaction.TransactionException">cmm/error/transactionFailure</prop>
                <prop key="egovframework.rte.fdl.cmmn.exception.EgovBizException">cmm/error/egovError</prop>
                <prop key="org.springframework.security.AccessDeniedException">cmm/error/accessDenied</prop>
            </props>
        </property>
    </bean>

	<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" id="viewResolver" p:order="0"/>

    <!-- 화면처리용 JSP 파일명의  prefix, suffix 처리에 대한 mvc 설정  -->
    <bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" p:order="1"
	    p:viewClass="org.springframework.web.servlet.view.JstlView"
	    p:prefix="/WEB-INF/jsp/" p:suffix=".jsp"/>
	
	<!-- json 추가 -->
    <bean id="jsonView" class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
		<property name="contentType" value="text/html;charset=UTF-8"/>
	</bean>
	
    <!-- Annotation 을 사용하지 않는 경우에 대한 MVC 처리 설정 -->
    <mvc:view-controller path="/cmmn/validator.do" view-name="cmmn/validator"/>
    
    <mvc:annotation-driven/>
	<!--  System Log Aspect -->
	<bean id="syslog" class="itn.let.sym.log.lgm.service.EgovSysLogAspect" />
	<aop:config>
		<!-- 관리자 로그를 위한 메소드 -->
		<aop:aspect id="sysLogAspect" ref="syslog">
			<aop:after pointcut="( execution(public * itn..*Controller.select*(..)) ||
			    execution(public * itn..*Controller.insert*(..)) ||
			    execution(public * itn..*Controller.update*(..)) ||
			    execution(public * itn..*Controller.delete*(..)) )
			    &amp;&amp;
			    !(execution(public * itn..*Controller.selectMainMenuHead(..)) || 
	              execution(public * itn..*Controller.selectMainMenuLeft(..)) || 
	              execution(public * itn..*Controller.*Web(..)) )"  method="logAdminSelect" />
		</aop:aspect>
	</aop:config>
</beans>