Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <context-param>
- <param-name>spring.profiles.active</param-name>
- <param-value>test, dev, prod</param-value>
- </context-param>
- > ls src/main/webapp/resources/properties/
- application-dev.properties application-prod.properties application-test.properties
- jdbc.driverClassName=org.postgresql.Driver
- jdbc.url=jdbc:postgresql://localhost:5432/galapagos
- jdbc.username=foo
- jdbc.password=
- <?xml version="1.0" encoding="UTF-8"?>
- <beans:beans xmlns="http://www.springframework.org/schema/mvc"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
- 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.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
- ....
- <!-- Database / JDBC -->
- <beans:bean
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <beans:property name="location" value="resources/properties/application.properties" />
- </beans:bean>
- <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
- <beans:property name="driverClassName" value="${jdbc.driverClassName}" />
- <beans:property name="url" value="${jdbc.url}" />
- <beans:property name="username" value="${jdbc.username}" />
- <beans:property name="password" value="${jdbc.password}" />
- </beans:bean>
- ....
- </beans:beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement