📄 error.jsp
字号:
<%/** * $RCSfile: error.jsp,v $ * $Revision: 1.3 $ * $Date: 2002/10/28 02:35:23 $ */%><%@ page import="java.io.*, java.util.*, java.net.*, com.jivesoftware.forum.*, com.jivesoftware.util.*, com.jivesoftware.forum.util.*, com.jivesoftware.base.*" isErrorPage="true"%><% // Get the Jive locale: Locale locale = JiveGlobals.getLocale(); // Get the URI/query string of the page that threw an error: (this value // is set in global.jsp and exists for every page) String uri = (String)request.getAttribute("jive.uri"); // If DEBUG is set to true, stack traces will be written to your // System.err log boolean DEBUG = "true".equals(JiveGlobals.getJiveProperty("skin.default.debug")); if (DEBUG) { System.err.println("Jive Forums Error:"); exception.printStackTrace(); } String stackTrace = null; if (exception != null) { StringWriter sout = new StringWriter(); PrintWriter pout = new PrintWriter(sout); exception.printStackTrace(pout); stackTrace = sout.toString(); stackTrace = StringUtils.replace(stackTrace,"\n","<br>"); stackTrace = StringUtils.replace(stackTrace,"\r",""); stackTrace = StringUtils.replace(stackTrace,"\"","'"); } // Do a check to see what type of exception the exception variable is. boolean isLicenseEx = false; boolean isUnauthEx = false; boolean isForumNotFoundEx = false; boolean isThreadNotFoundEx = false; boolean isMessageNotFoundEx = false; boolean isUserNotFoundEx = false; boolean isAttachEx = false; boolean isUnsupportedOpEx = false; if (exception instanceof LicenseException) { isLicenseEx = true; } else if (exception instanceof UnauthorizedException) { isUnauthEx = true; } else if (exception instanceof ForumNotFoundException) { isForumNotFoundEx = true; } else if (exception instanceof ForumThreadNotFoundException) { isThreadNotFoundEx = true; } else if (exception instanceof ForumMessageNotFoundException) { isMessageNotFoundEx = true; } else if (exception instanceof UserNotFoundException) { isUserNotFoundEx = true; } else if (exception instanceof AttachmentException) { isAttachEx = true; } else if (exception instanceof UnsupportedOperationException) { isUnsupportedOpEx = true; } // If it's an UnauthorizedException, redirect to the login page if (isUnauthEx) { response.sendRedirect("auth.jsp?unauth=true"); return; }%><html><head> <title>Jive Forums Error</title> <script language="JavaScript" type="text/javascript"> <!-- function openWin() { var options = "menubar=yes,location=no,scrollbars=yes,personalbar=no,width=600,height=400,resizable"; var newWin = window.open("","stackTraceWindow",options); newWin.document.writeln("<html><head><title>Jive Forums Error" + "</title></head><body><b>Summary:</b>" + "<hr size=\"0\">Version: " + "<%= Version.getVersionNumber() %><hr size=\"0\">" + "Stack Trace: <br><pre>"); <% if (stackTrace != null) { %> newWin.document.writeln("<%= stackTrace %>"); <% } else { %> newWin.document.writeln("<i>No Stack Trace available</i>"); <% } %> newWin.document.writeln("</pre></body></html>"); } //--> </script></head><body><font face="arial,helvetica,sans-serif"><b><%= LocaleUtils.getLocalizedString("skin.default.error.title") %></b><hr size="0"><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"><% if (isLicenseEx) { %> There is an error with your jive.license file. It may have expired or be installed in the wrong place.<% } else if (isForumNotFoundEx) { %> The requested forum was not found.<% } else if (isThreadNotFoundEx) { %> The requested thread was not found.<% } else if (isMessageNotFoundEx) { %> The requested message was not found.<% } else if (isUserNotFoundEx) { %> The requested user was not found.<% } else if (isUnsupportedOpEx) { %> Part of the custom user, group or authorization implementation is unsupported or unimplemented. Please check the appserver error logs for more details.<% } else { // general error %> An error occured processing your request. If this problem persists, please contact the webmaster or administrator of this site.<% } %></font><p><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"><a href="#" onclick="openWin();return false;">Error Summary</a></font><% if (DEBUG) { %><p><pre><%= stackTrace %></pre><% } %></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -