summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-10-18 15:16:42 -0700
committerJesse Morgan <jesse@jesterpm.net>2013-10-18 15:16:42 -0700
commita3a7bd3c2fcdc152e07dbd830719a2009ca0c61c (patch)
tree3fa10f3527aab5aa93c88021a6d654a7c5487d38
parent7570c5684c3e2c334aa1b647d87915414ad93ee2 (diff)
Fixing config issues when not running in tomcat
-rw-r--r--build.xml4
-rw-r--r--src/com/p4square/grow/frontend/ErrorPage.java8
-rw-r--r--src/com/p4square/grow/frontend/GrowFrontend.java2
3 files changed, 9 insertions, 5 deletions
diff --git a/build.xml b/build.xml
index 02b70b7..75e514d 100644
--- a/build.xml
+++ b/build.xml
@@ -18,7 +18,7 @@
<java classname="com.p4square.grow.frontend.GrowFrontend"
classpathref="classpath.run" fork="true">
- <arg file="build/WEB-INF/classes/grow.properties" />
+ <arg file="devfiles/grow-server.properties" />
</java>
</target>
@@ -26,7 +26,7 @@
<java classname="com.p4square.grow.backend.GrowBackend"
classpathref="classpath.run" fork="true">
- <arg file="build/WEB-INF/classes/grow.properties" />
+ <arg file="devfiles/grow-server.properties" />
</java>
</target>
diff --git a/src/com/p4square/grow/frontend/ErrorPage.java b/src/com/p4square/grow/frontend/ErrorPage.java
index 721b477..39aae93 100644
--- a/src/com/p4square/grow/frontend/ErrorPage.java
+++ b/src/com/p4square/grow/frontend/ErrorPage.java
@@ -18,6 +18,8 @@ import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.representation.WriterRepresentation;
+import net.jesterpm.fmfacade.FreeMarkerPageResource;
+
/**
* ErrorPage wraps a String or Template Representation and displays the given
* error message.
@@ -35,6 +37,7 @@ public class ErrorPage extends WriterRepresentation {
new ErrorPage("Error communicating with backend.");
private static Template cTemplate = null;
+ private static Map<String, Object> cRoot = null;
private final String mMessage;
@@ -48,8 +51,9 @@ public class ErrorPage extends WriterRepresentation {
mMessage = msg;
}
- public static synchronized void setTemplate(Template template) {
+ public static synchronized void setTemplate(Template template, Map<String, Object> root) {
cTemplate = template;
+ cRoot = root;
}
protected Representation getRepresentation() {
@@ -57,7 +61,7 @@ public class ErrorPage extends WriterRepresentation {
return new StringRepresentation(mMessage);
} else {
- Map<String, Object> root = new HashMap<String, Object>();
+ Map<String, Object> root = new HashMap<String, Object>(cRoot);
root.put("errorMessage", mMessage);
return new TemplateRepresentation(cTemplate, root, MediaType.TEXT_HTML);
}
diff --git a/src/com/p4square/grow/frontend/GrowFrontend.java b/src/com/p4square/grow/frontend/GrowFrontend.java
index a1e3488..3e50c65 100644
--- a/src/com/p4square/grow/frontend/GrowFrontend.java
+++ b/src/com/p4square/grow/frontend/GrowFrontend.java
@@ -67,7 +67,7 @@ public class GrowFrontend extends FMFacade {
public synchronized void start() throws Exception {
Template errorTemplate = getTemplate("templates/error.ftl");
if (errorTemplate != null) {
- ErrorPage.setTemplate(errorTemplate);
+ ErrorPage.setTemplate(errorTemplate, FreeMarkerPageResource.baseRootObject(getContext()));
}
super.start();