You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/05/24 06:58:51 UTC
[3/3] isis git commit: ISIS-1406: fixing regression...
isis.config.dir override was not being picked up.
ISIS-1406: fixing regression... isis.config.dir override was not being picked up.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/874e8bad
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/874e8bad
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/874e8bad
Branch: refs/heads/master
Commit: 874e8bad162255c644f133f4e48eeb00d7c4adc9
Parents: ec38b4b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue May 24 07:53:06 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue May 24 07:53:06 2016 +0100
----------------------------------------------------------------------
.../core/webapp/IsisWebAppBootstrapper.java | 9 +++--
.../webapp/src/main/webapp/WEB-INF/web.xml | 41 ++++++++++++--------
2 files changed, 31 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/874e8bad/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
index 977f700..a3226bf 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
@@ -131,9 +131,6 @@ public class IsisWebAppBootstrapper implements ServletContextListener {
final ServletContext servletContext,
final IsisConfigurationBuilder isisConfigurationBuilder) {
- isisConfigurationBuilder.addResourceStreamSource(ResourceStreamSourceContextLoaderClassPath.create());
- isisConfigurationBuilder.addResourceStreamSource(new ResourceStreamSourceCurrentClassClassPath());
- isisConfigurationBuilder.addResourceStreamSource(new ResourceStreamSourceForWebInf(servletContext));
// will load either from WEB-INF, from the classpath or from config directory.
final String configLocation = servletContext.getInitParameter(WebAppConstants.CONFIG_DIR_PARAM);
@@ -142,7 +139,13 @@ public class IsisWebAppBootstrapper implements ServletContextListener {
isisConfigurationBuilder.addResourceStreamSource(ResourceStreamSourceFileSystem.create(configLocation));
} else {
LOG.info( "Config override location: No override location configured" );
+
+ isisConfigurationBuilder.addResourceStreamSource(ResourceStreamSourceContextLoaderClassPath.create());
+ isisConfigurationBuilder.addResourceStreamSource(new ResourceStreamSourceCurrentClassClassPath());
+ isisConfigurationBuilder.addResourceStreamSource(new ResourceStreamSourceForWebInf(servletContext));
}
+
+
}
private Injector createGuiceInjector(
http://git-wip-us.apache.org/repos/asf/isis/blob/874e8bad/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/web.xml b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/web.xml
index 1c3ef1d..1adf47b 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/web.xml
@@ -46,24 +46,33 @@
<!-- which configuration directory to read overloaded property files from -->
<!--
- Normally configuration like this should be done from outside your web
- application. Especially if your configuration is not know in advance or
- if it can change depending on where the application gets deployed.
-
- For instance to configure this in Tomcat outside the application WAR add
- the following line to your application context ( For more detail see:
- http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Context_Parameters )
-
- <Parameter name="isis.config.dir" value="/usr/local/tomcat/conf/"
- override="true"/>
-
- If your configuration directory is fixed you can enable the following
- context parameter in here and forget about the outside part.
-
+ By default the framework will read configuration properties from the WEB-INF
+ directory (where this web.xml file resides).
+
+ If you want to read configuration files from some other external directory,
+ and the location of that external directory is the same/standardized for all
+ locations where you intend to deploy the WAR file, you can uncomment the
+ 'isis.config.dir' context parameter, below, and set it to that standardized
+ location, eg:
+
<context-param>
- <param-name>isis.config.dir</param-name>
- <param-value>location of your config directory if fixed</param-value>
+ <param-name>isis.config.dir</param-name>
+ <param-value>/usr/local/conf</param-value>
</context-param>
+
+ If however the location of the external directory changes from one deployment
+ to another (eg system testing, UAT, production etc) then you should be
+ able to override the context parameter through the servlet container's own
+ (proprietary) configuration files.
+
+ For example, if deploying to Tomcat, you can edit $CATALINA_BASE/conf/context.xml,
+ and add:
+
+ <Parameter name="isis.config.dir"
+ value="/usr/local/conf/systest"
+ override="false"/>
+
+ For more detail see: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Context_Parameters
-->