add custom error page
This commit is contained in:
@ -123,6 +123,7 @@
|
|||||||
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/commons-logging.jar" />
|
<pathelement location="../../jetty/jettylib/commons-logging.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/commons-el.jar" />
|
<pathelement location="../../jetty/jettylib/commons-el.jar" />
|
||||||
|
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
||||||
<pathelement location="../../systray/java/build/obj" />
|
<pathelement location="../../systray/java/build/obj" />
|
||||||
<pathelement location="../../systray/java/lib/systray4j.jar" />
|
<pathelement location="../../systray/java/lib/systray4j.jar" />
|
||||||
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" />
|
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" />
|
||||||
|
32
apps/routerconsole/jsp/error.jsp
Normal file
32
apps/routerconsole/jsp/error.jsp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<%@page contentType="text/html"%>
|
||||||
|
<%@page pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<%
|
||||||
|
// 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...
|
||||||
|
%>
|
||||||
|
<html><head>
|
||||||
|
<title>I2P Router Console</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<%@include file="css.jsp" %>
|
||||||
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
|
</head><body>
|
||||||
|
<%
|
||||||
|
if (System.getProperty("router.consoleNonce") == null) {
|
||||||
|
System.setProperty("router.consoleNonce", new java.util.Random().nextLong() + "");
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<%@include file="summary.jsp" %>
|
||||||
|
<h1><%=ERROR_CODE%> <%=ERROR_MESSAGE%></h1>
|
||||||
|
<div class="warning" id="warning">
|
||||||
|
The Router Console page <%=ERROR_URI%> was not found.
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -21,4 +21,8 @@
|
|||||||
<welcome-file>index.html</welcome-file>
|
<welcome-file>index.html</welcome-file>
|
||||||
<welcome-file>index.jsp</welcome-file>
|
<welcome-file>index.jsp</welcome-file>
|
||||||
</welcome-file-list>
|
</welcome-file-list>
|
||||||
|
<error-page>
|
||||||
|
<error-code>404</error-code>
|
||||||
|
<location>/error.jsp</location>
|
||||||
|
</error-page>
|
||||||
</web-app>
|
</web-app>
|
||||||
|
Reference in New Issue
Block a user