From 880c619ef46a6ff05329d7d09932f5786830cc0e Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Fri, 14 Jun 2013 10:27:57 +0300 Subject: [PATCH] Introduce a 'production' profile to use a JNDI datasource instead of the datasource instantiated by the .war application. 1. Remove the `spring.profiles.active` web context-param to allow overriding of the application's profile by a system property -> `web.xml` 2. Associate the JDBC repositories implementation with the `default` profile in addition to the existing association with the `jdbc` profile -> `business-config.xml` 3. allow to override values of `data-access.properties` with system properties -> `business-config.xml` and `datasource-config.xml` 4. introduce a `production` profile to use the JNDI datasource instead of the embedded datasource -> `datasource-config.xml` --- src/main/resources/spring/business-config.xml | 4 ++-- .../resources/spring/datasource-config.xml | 19 +++++++++++-------- src/main/webapp/WEB-INF/web.xml | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/main/resources/spring/business-config.xml b/src/main/resources/spring/business-config.xml index 731bd1c25..0cf02492a 100644 --- a/src/main/resources/spring/business-config.xml +++ b/src/main/resources/spring/business-config.xml @@ -20,7 +20,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/src/main/resources/spring/datasource-config.xml b/src/main/resources/spring/datasource-config.xml index 0151d2799..ee1da4e65 100644 --- a/src/main/resources/spring/datasource-config.xml +++ b/src/main/resources/spring/datasource-config.xml @@ -5,11 +5,14 @@ @@ -17,20 +20,16 @@ - + - - - - @@ -38,4 +37,8 @@ + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 000f6244c..e65cf7802 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -8,15 +8,21 @@ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" Spring PetClinic Spring PetClinic sample application + + jpa + -->