<?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:jee="http://www.springframework.org/schema/jee"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-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/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd">
<!-- The controllers are autodetected POJOs labeled with the @Controller, @Service, @Component annotation. -->
<!-- @Controller, @Service, @Component annotation 아래의 package를 스켄하여 @Autowired
어노테이션을 이용하여 해당하는 엔티티 및 서비스를 맵핑한다. -->
<!-- <context:component-scan base-package="com.isource.web.controller, com.isource.domain.service,
com.isource.web.validator, com.isource.web.security"/> -->
<context:component-scan base-package="com.myPackage.web" />
<mvc:resources location="/WEB-INF/resources/" mapping="/resources/**" />
<context:annotation-config></context:annotation-config>
<!-- <task:executor id="taskExecutor" pool-size="5"/>
<task:annotation-driven executor="taskExecutor"/> -->
<!-- Annotation 기반 트랜잭션 설정 -->
<tx:annotation-driven transaction-manager="oracleTransactionManager" />
<!-- 트랜잭션 매니저 -->
<bean id="oracleTransactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:/mybatis/mybatisConfig.xml" />
<property name="mapperLocations" value="classpath:/mybatis/sql/**/*.xml" />
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
<bean id="sqlBatchSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
<constructor-arg index="1" value="BATCH" />
</bean>
<bean id="anotherTransactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="anotherDataSource" />
</bean>
<bean id="anotherSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="anotherDataSource" />
<property name="configLocation" value="classpath:/mybatis/mybatisConfig_another.xml" />
<property name="mapperLocations" value="classpath:/mybatis/sql_another/**/*.xml" />
</bean>
<bean id="anotherSqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="anotherSqlSessionFactory" />
</bean>
<bean id="anotherBatchSqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="anotherSqlSessionFactory" />
<constructor-arg index="1" value="BATCH" />
</bean>
<!-- Validation 활성화(validator="validator"), conversionService 활성화, 메세지 컨버터
등록 (JSON을 바꿔주는부분) -->
<mvc:annotation-driven conversion-service="conversionService">
<mvc:message-converters>
<bean
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="objectMapper">
<bean class="com.myPackage.web.converter.CustomObjectMapper" />
</property>
</bean>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**" />
<mvc:exclude-mapping path="/login**" />
<mvc:exclude-mapping path="/login*" />
<mvc:exclude-mapping path="/loginform**" />
<mvc:exclude-mapping path="/resources/**" />
<mvc:exclude-mapping path="/*.ico" />
<bean class="com.isource.web.controller.IsourceInterceptor" />
</mvc:interceptor>
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="convertLocale" />
</bean>
</mvc:interceptors>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="ko" />
</bean>
<!-- Configure the multipart resolver -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes about
10MB -->
<property name="maxUploadSize" value="10000000" />
</bean>
<alias name="multipartResolver" alias="multipartResolver" />
<!-- Configure the file upload directory -->
<!-- <bean id="uploadDirResource" class="org.springframework.core.io.FileSystemResource">
<constructor-arg> <value>C:/myPackage/upload/</value> </constructor-arg> </bean> -->
<!-- tiles 2에서 전부처리되어 주석처리됨. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:order="2" p:prefix="/WEB-INF/views/" p:suffix=".jsp"/> -->
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver" p:order="1" p:viewClass="org.springframework.web.servlet.view.tiles2.TilesView" />
<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" id="tilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles/tiles-def.xml</value>
</list>
</property>
</bean>
<!-- @Valid 에서 스프링의 Message.properties를 사용하기 위해 추기 -->
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource" />
</bean>
<!-- Message -->
<bean id="messageSource"
class="com.myPackage.extendz.IscReloadableResourceBundleMessageSource">
<!-- class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> -->
<property name="defaultEncoding" value="UTF-8" />
<property name="basenames">
<list>
<value>classpath:/messages/messages</value>
<value>classpath:/messages/buttons</value>
<value>classpath:/messages/labels</value>
</list>
</property>
</bean>
<!-- Exception 처리 -->
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver">
<property name="order" value="1" />
</bean>
<bean
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="order" value="2" />
<property name="defaultErrorView" value="/common/error500" />
<!--.main 은 타일즈 standalone layout 적용 -->
</bean>
<!-- Conversion Service 기본 포멧터 사용 -->
<bean id="conversionService"
class="org.springframework.format.support.FormattingConversionServiceFactoryBean" />
<bean id="logDataSource_pos" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
<constructor-arg ref="dataSource" />
<property name="logFormatter">
<bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
<property name="loggingType" value="MULTI_LINE" />
<property name="sqlPrefix" value="SQL=>" />
</bean>
</property>
</bean>
<!-- Quartz -->
<bean id="batchService" class="com.myPackage.schedule.quartz.job.service.BatchService" />
<bean id="sapJcoTransfer" class="com.myPackage.schedule.quartz.job.transfer.SapJcoTransfer" />
<bean id="procedureTransfer" class="com.myPackage.schedule.quartz.job.transfer.ProcedureTransfer" />
<bean name="isourceJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean" p:jobClass="com.isource.schedule.quartz.job.IsourceQuartzJobBean" p:durability="true">
<property name="jobDataAsMap">
<map>
<entry key="batchService" value-ref="batchService" />
</map>
</property>
</bean>
<!-- <bean id="cronTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="isourceJob" p:startDelay="0" p:cronExpression="0/10 * * * * ?" /> -->
<bean id="SimpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<property name="jobDetail" ref="isourceJob" />
<property name="startDelay" value="0" />
<property name="repeatInterval" value="604800000" />
</bean>
<bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="SimpleTrigger" />
</list>
</property>
</bean>
<bean class="com.myPackage.common.util.ApplicationContextAwareExtends"/>
<bean class="com.myPackage.common.helper.mail.MailSendWorker">
<constructor-arg>
<ref bean="naverMailSender" />
</constructor-arg>
</bean>
<!-- Gmail setting -->
<bean name="gmailMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"
p:password="input your password"
p:host="smtp.gmail.com"
p:port="587"
p:protocol="smtp"
p:username="input your account"
p:defaultEncoding="utf-8">
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.ssl.enable">false</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.smtp.ssl.trust">*</prop>
<prop key="mail.smtp.port">587</prop><!-- mail.smtp.ssl.enable true인 경우 주석처리후 사용 -->
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.debug">true</prop>
</props>
</property>
</bean>
<!-- naver setting -->
<bean name="naverMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"
p:password="input your password"
p:host="smtp.naver.com"
p:port="465"
p:protocol="smtps"
p:username="input your account"
p:defaultEncoding="utf-8">
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.ssl.enable">true</prop>
<prop key="mail.smtps.ssl.checkserveridentity">true</prop>
<prop key="mail.smtps.ssl.trust">*</prop>
<prop key="mail.debug">false</prop>
</props>
</property>
</bean>
<!-- Local Stmp setting -->
<bean name="customMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"
p:host="smtp.mailplug.co.kr"
p:protocol="SSL"
p:defaultEncoding="utf-8">
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.port">465</prop>
<prop key="mail.smtp.starttls.enable">false</prop>
<prop key="mail.smtp.ssl.enable">true</prop>
<prop key="mail.smtp.ssl.trust">*</prop>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.debug">true</prop>
</props>
</property>
<!-- <property name="username" value="customSTMPUser"/>
<property name="password" value="customSTMPPassword"/> -->
</bean>
</beans>