spring-context-local-dev.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:task="http://www.springframework.org/schema/task"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:mvc="http://www.springframework.org/schema/mvc"
  8. xmlns:util="http://www.springframework.org/schema/util"
  9. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  10. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  11. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  12. http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
  13. http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  14. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
  15. <context:component-scan base-package="com.dbs.mplus" />
  16. <!-- 정적 환경설정 -->
  17. <!-- <util:properties id="mplusConfig" location="WEB-INF/config/env-local-${spring.profiles.active}.xml" /> -->
  18. <!-- 정적 환경설정 : 단독으로 실험하고 싶을 때 -->
  19. <util:properties id="mplusConfig" location="WEB-INF/config/env-local-dev.xml" />
  20. <context:property-placeholder properties-ref="mplusConfig"/>
  21. <tx:annotation-driven transaction-manager="mplusTransactionManager" />
  22. <bean id="mplusTransactionManager"
  23. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  24. <property name="dataSource" ref="mplusDataSource" />
  25. </bean>
  26. <bean id="mpNamedParameterJdbcTemplate"
  27. class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
  28. <constructor-arg>
  29. <ref bean="mplusDataSource" />
  30. </constructor-arg>
  31. </bean>
  32. <!-- M-Care 서비스용 데이터 소스 -->
  33. <bean id="mplusDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  34. <property name="driverClassName" value="#{mplusConfig['mplus.db.driverClassName']}" />
  35. <property name="url" value="#{mplusConfig['mplus.db.url']}" />
  36. <property name="username" value="#{mplusConfig['mplus.db.username']}" />
  37. <property name="password" value="#{mplusConfig['mplus.db.password']}" />
  38. <property name="validationQuery" value="select 1" />
  39. <property name="testWhileIdle" value="true" />
  40. </bean>
  41. <!-- M-Care 서비스를 위한 중간 테이블에 접근하기 위한 데이터 소스 -->
  42. <bean id="mplusExtDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  43. <property name="driverClassName" value="#{mplusConfig['mplus.ext.db.driverClassName']}" />
  44. <property name="url" value="#{mplusConfig['mplus.ext.db.url']}" />
  45. <property name="username" value="#{mplusConfig['mplus.ext.db.username']}" />
  46. <property name="password" value="#{mplusConfig['mplus.ext.db.password']}" />
  47. </bean>
  48. <bean id="messageSource"
  49. class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
  50. <property name="basenames">
  51. <list>
  52. <value>WEB-INF/messages/message</value>
  53. <value>WEB-INF/messages/version</value>
  54. </list>
  55. </property>
  56. <property name="defaultEncoding" value="UTF-8" />
  57. <property name="cacheSeconds" value="180" />
  58. </bean>
  59. <bean id="localeResolver"
  60. class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
  61. <property name="cookieName" value="user_locale" />
  62. <property name="cookieMaxAge" value="31536000" />
  63. <property name="defaultLocale" value="ko" />
  64. </bean>
  65. <mvc:interceptors>
  66. <bean id="localeChangeInterceptor"
  67. class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
  68. <property name="paramName" value="_locale" />
  69. </bean>
  70. <mvc:interceptor>
  71. <mvc:mapping path="/**/*.page"/>
  72. <mvc:mapping path="/**/*.json"/>
  73. <mvc:mapping path="/**/*.ext"/>
  74. <!--
  75. <mvc:exclude-mapping path="/**/login.page"/>
  76. -->
  77. <mvc:exclude-mapping path="/**/logout.page"/>
  78. <mvc:exclude-mapping path="/*/test/*"/>
  79. <bean class="com.dbs.mplus.interceptor.MPlusAuthenticationInterceptor" />
  80. </mvc:interceptor>
  81. </mvc:interceptors>
  82. <!-- MultipartResolver 설정 -->
  83. <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  84. <property name="maxUploadSize" value="20000000" />
  85. <property name="maxInMemorySize" value="20000000" />
  86. </bean>
  87. <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
  88. <property name="order" value="1" />
  89. <!-- <property name="mediaTypes">
  90. <map>
  91. <entry key="page" value="text/html" />
  92. <entry key="json" value="application/json" />
  93. <entry key="ext" value="text/html" />
  94. </map>
  95. </property> -->
  96. <property name="viewResolvers">
  97. <list>
  98. <bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  99. <property name="viewClass"
  100. value="org.springframework.web.servlet.view.tiles3.TilesView" />
  101. </bean>
  102. <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
  103. </list>
  104. </property>
  105. <property name="defaultViews">
  106. <list>
  107. <ref bean="jsonView" />
  108. </list>
  109. </property>
  110. </bean>
  111. <bean id="tilesConfigurer"
  112. class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
  113. <property name="definitions">
  114. <list>
  115. <value>/WEB-INF/config/tiles/template.xml</value>
  116. </list>
  117. </property>
  118. </bean>
  119. <bean class="org.springframework.web.servlet.view.BeanNameViewResolver">
  120. <property name="order" value="0" />
  121. </bean>
  122. <bean id="download" class="com.dbs.mplus.service.DownloadView" />
  123. <bean id="jsonView" class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
  124. <mvc:annotation-driven>
  125. <mvc:message-converters>
  126. <bean class="org.springframework.http.converter.StringHttpMessageConverter">
  127. <property name="supportedMediaTypes">
  128. <list>
  129. <value>text/html;charset=UTF-8</value>
  130. </list>
  131. </property>
  132. </bean>
  133. <bean class="org.springframework.http.converter.FormHttpMessageConverter">
  134. <property name="charset">
  135. <bean class="java.nio.charset.Charset" factory-method="forName">
  136. <constructor-arg value="UTF-8" />
  137. </bean>
  138. </property>
  139. </bean>
  140. </mvc:message-converters>
  141. </mvc:annotation-driven>
  142. <!-- application 확인용 -->
  143. <bean id="frameworkAppListener" class="com.dbs.mplus.framework.listener.MPlusFrameworkApplicationListener"/>
  144. <bean id="serviceAppListener" class="com.dbs.mplus.listener.MPlusServiceApplicationListener"/>
  145. </beans>