summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/frontend/GrowFrontend.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-06-09 17:35:48 -0700
committerJesse Morgan <jesse@jesterpm.net>2013-06-09 17:35:48 -0700
commit69e2512750dd75fce43a21226979996c3cd7da1d (patch)
tree691dca375161583393ce32bb0869cb7449255118 /src/com/p4square/grow/frontend/GrowFrontend.java
parentf4c2eb2dafbca580319a9f50ef4f5dd68d658702 (diff)
Configuration Changes
Fixing a bug in the config class and updating all templates and pages to use the dynamicRoot and staticRoot config values to prefix URLs.
Diffstat (limited to 'src/com/p4square/grow/frontend/GrowFrontend.java')
-rw-r--r--src/com/p4square/grow/frontend/GrowFrontend.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/p4square/grow/frontend/GrowFrontend.java b/src/com/p4square/grow/frontend/GrowFrontend.java
index e3662d5..226929d 100644
--- a/src/com/p4square/grow/frontend/GrowFrontend.java
+++ b/src/com/p4square/grow/frontend/GrowFrontend.java
@@ -41,13 +41,15 @@ public class GrowFrontend extends FMFacade {
super.start();
final String configDomain =
- getContext().getParameters().getFirstValue("config-domain");
+ getContext().getParameters().getFirstValue("configDomain");
if (configDomain != null) {
mConfig.setDomain(configDomain);
}
+ mConfig.updateConfig(this.getClass().getResourceAsStream("/grow.properties"));
+
final String configFilename =
- getContext().getParameters().getFirstValue("config-file");
+ getContext().getParameters().getFirstValue("configFile");
if (configFilename != null) {
mConfig.updateConfig(configFilename);
@@ -58,8 +60,10 @@ public class GrowFrontend extends FMFacade {
protected Router createRouter() {
Router router = new Router(getContext());
+ final String loginPage = getConfig().getString("dynamicRoot", "") + "/login.html";
+
final LoginAuthenticator defaultGuard =
- new LoginAuthenticator(getContext(), true, "login.html");
+ new LoginAuthenticator(getContext(), true, loginPage);
defaultGuard.setNext(FreeMarkerPageResource.class);
router.attachDefault(defaultGuard);
router.attach("/login.html", LoginPageResource.class);
@@ -69,7 +73,7 @@ public class GrowFrontend extends FMFacade {
accountRouter.attach("/assessment", SurveyPageResource.class);
final LoginAuthenticator accountGuard =
- new LoginAuthenticator(getContext(), false, "login.html");
+ new LoginAuthenticator(getContext(), false, loginPage);
accountGuard.setNext(accountRouter);
router.attach("/account", accountGuard);