From 7aa051ef4f2a479195aa868dfa5187db3736d7a6 Mon Sep 17 00:00:00 2001 From: zzz Date: Sun, 2 Aug 2009 20:12:16 +0000 Subject: [PATCH] add custom error page --- apps/routerconsole/java/build.xml | 1 + apps/routerconsole/jsp/error.jsp | 32 +++++++++++++++++++++++++++++++ apps/routerconsole/jsp/web.xml | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 apps/routerconsole/jsp/error.jsp diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml index d571e48095..f77a14387a 100644 --- a/apps/routerconsole/java/build.xml +++ b/apps/routerconsole/java/build.xml @@ -123,6 +123,7 @@ + diff --git a/apps/routerconsole/jsp/error.jsp b/apps/routerconsole/jsp/error.jsp new file mode 100644 index 0000000000..da2dfeac88 --- /dev/null +++ b/apps/routerconsole/jsp/error.jsp @@ -0,0 +1,32 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<% + // Let's make this easy... + final Integer ERROR_CODE = (Integer) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_STATUS_CODE); + final String ERROR_URI = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_REQUEST_URI); + final String ERROR_MESSAGE = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_MESSAGE); + if (ERROR_CODE != null && ERROR_MESSAGE != null) { + // this is deprecated but we don't want sendError() + response.setStatus(ERROR_CODE.intValue(), ERROR_MESSAGE); + } + // If it can't find the iframe or viewtheme.jsp I wonder if the whole thing blows up... +%> + +I2P Router Console + +<%@include file="css.jsp" %> + + +<% +if (System.getProperty("router.consoleNonce") == null) { + System.setProperty("router.consoleNonce", new java.util.Random().nextLong() + ""); +} +%> +<%@include file="summary.jsp" %> +

<%=ERROR_CODE%> <%=ERROR_MESSAGE%>

+
+The Router Console page <%=ERROR_URI%> was not found. +
+ + diff --git a/apps/routerconsole/jsp/web.xml b/apps/routerconsole/jsp/web.xml index 7a8e431ce7..a0436d3056 100644 --- a/apps/routerconsole/jsp/web.xml +++ b/apps/routerconsole/jsp/web.xml @@ -21,4 +21,8 @@ index.html index.jsp + + 404 + /error.jsp +