diff --git a/apps/routerconsole/jsp/error500.jsp b/apps/routerconsole/jsp/error500.jsp new file mode 100644 index 000000000..7c496685c --- /dev/null +++ b/apps/routerconsole/jsp/error500.jsp @@ -0,0 +1,63 @@ +<%@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); + final Class ERROR_CLASS = (Class)request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_EXCEPTION_TYPE); + final Throwable ERROR_THROWABLE = (Throwable)request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_EXCEPTION); + if (ERROR_CODE != null && ERROR_MESSAGE != null) { + // this is deprecated but we don't want sendError() + response.setStatus(ERROR_CODE.intValue(), ERROR_MESSAGE); + } +%> + +<%@include file="css.jsi" %> +<%=intl.title("Internal Error")%> + +
+
+"><%=intl._(" border="0">
+<%=intl._("Configuration")%> <%=intl._("Help")%> +
+

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

+
+<%=intl._("Sorry! There has been an internal error.")%> +
+

+<% /* note to translators - both parameters are URLs */ +%><%=intl._("Please report bugs on {0} or {1}.", + "trac.i2p2.i2p", + "trac.i2p2.de")%> +<%=intl._("You may use the username \"guest\" and password \"guest\" if you do not wish to register.")%> +

<%=intl._("Please include this information in bug reports")%>: +

+

<%=intl._("Error Details")%>

+

+<%=intl._("Error {0}", ERROR_CODE)%>: <%=ERROR_URI%> <%=ERROR_MESSAGE%> +

+<% + if (ERROR_THROWABLE != null) { + java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(2048); + java.io.PrintStream ps = new java.io.PrintStream(baos); + ERROR_THROWABLE.printStackTrace(ps); + ps.close(); + String trace = baos.toString(); + trace = trace.replace("&", "&").replace("<", "<").replace(">", ">"); + trace = trace.replace("\n", "
    \n"); + out.print(trace); + } +%> +

+

<%=intl._("I2P Version & Running Environment")%>

+

+I2P version: <%=net.i2p.router.RouterVersion.FULL_VERSION%>
+Java version: <%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%> (<%=System.getProperty("java.runtime.name")%> <%=System.getProperty("java.runtime.version")%>)
+Platform: <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%>
+Processor: <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)
+Jbigi: <%=net.i2p.util.NativeBigInteger.loadStatus()%>
+Encoding: <%=System.getProperty("file.encoding")%>

+

<%=intl._("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%>

+
diff --git a/apps/routerconsole/jsp/web.xml b/apps/routerconsole/jsp/web.xml index e5bdbeb32..f519312e4 100644 --- a/apps/routerconsole/jsp/web.xml +++ b/apps/routerconsole/jsp/web.xml @@ -35,4 +35,8 @@ 404 /error.jsp + + 500 + /error500.jsp +