Skip to content

Commit

Permalink
- properties 설정 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
kurien92 committed Jan 11, 2021
1 parent 865ce19 commit 258efe6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
8 changes: 8 additions & 0 deletions src/main/resources/properties/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
db.driverClassName=org.mariadb.jdbc.Driver
db.url=jdbc:mariadb://mariadb:3306/kreblog?useTimezone=true&serverTimezone=Asia/Seoul&useSSL=false
db.username=kre
db.password=kre1234

redis.hostName=redis
redis.port=6379
redis.password=kre1234
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/spring/mybatis-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.mariadb.jdbc.Driver"/>
<property name="url" value="jdbc:mariadb://mariadb:3306/kreblog?useTimezone=true&amp;serverTimezone=Asia/Seoul&amp;useSSL=false"/>
<property name="username" value="kre"/>
<property name="password" value="kre1234"/>
<property name="driverClassName" value="${db.driverClassName}"/>
<property name="url" value="${db.url}"/>
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
</bean>

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/WEB-INF/spring/redis-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
</bean>

<bean id="redisStandaloneConfiguration" class="org.springframework.data.redis.connection.RedisStandaloneConfiguration"
p:host-name="redis"
p:port="6379"
p:host-name="${redis.hostName}"
p:port="${redis.port}"
p:password-ref="redisPassword"
/>

<bean id="redisPassword" class="org.springframework.data.redis.connection.RedisPassword">
<constructor-arg value="kre1234"/>
<constructor-arg value="${redis.password}"/>
</bean>

<util:constant id="configureRedisAction" static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
Expand Down
9 changes: 6 additions & 3 deletions src/main/webapp/WEB-INF/spring/root-context.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="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-3.2.xsd">

<!-- Root Context: defines shared resources visible to all other web components -->

<context:property-placeholder location="classpath:/properties/*.properties" />

</beans>

0 comments on commit 258efe6

Please sign in to comment.