From 96c4b0fea8203a0520a42b56c468dc7f3ca49673 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Sun, 22 Sep 2013 20:25:21 -0700 Subject: Fixing tomcat config overrides. Finally fixing config overrides. Found a bug? in restlet where the Servlet context parameters aren't passed to the final application. I'm working around the issue by creating my own component which builds the config and shares it with the frontend and backend. Overall I think it's a much more elegant solution. Now we have the ability to specify an external config file for the F1 credentials and the ability configure different domains in different tomcat containers. --- src/com/p4square/grow/frontend/GrowFrontend.java | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/com/p4square/grow/frontend/GrowFrontend.java') diff --git a/src/com/p4square/grow/frontend/GrowFrontend.java b/src/com/p4square/grow/frontend/GrowFrontend.java index 07abd16..ecb2475 100644 --- a/src/com/p4square/grow/frontend/GrowFrontend.java +++ b/src/com/p4square/grow/frontend/GrowFrontend.java @@ -55,28 +55,16 @@ public class GrowFrontend extends FMFacade { mConfig = new Config(); } + public GrowFrontend(Config config) { + mConfig = config; + } + public Config getConfig() { return mConfig; } @Override public synchronized void start() throws Exception { - final String configDomain = - getContext().getParameters().getFirstValue("configDomain"); - if (configDomain != null) { - mConfig.setDomain(configDomain); - } - - mConfig.updateConfig(this.getClass().getResourceAsStream("/grow.properties")); - - final String configFilename = - getContext().getParameters().getFirstValue("configFile"); - - if (configFilename != null) { - LOG.info("Loading configuration from " + configFilename); - mConfig.updateConfig(configFilename); - } - Template errorTemplate = getTemplate("templates/error.ftl"); if (errorTemplate != null) { ErrorPage.setTemplate(errorTemplate); -- cgit v1.2.3