You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/11/01 16:16:08 UTC
svn commit: r330070 - /incubator/roller/trunk/web/errorBody.jsp
Author: snoopdave
Date: Tue Nov 1 07:16:04 2005
New Revision: 330070
URL: http://svn.apache.org/viewcvs?rev=330070&view=rev
Log:
Added a null pointer check to errorBody.jsp
Modified:
incubator/roller/trunk/web/errorBody.jsp
Modified: incubator/roller/trunk/web/errorBody.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/errorBody.jsp?rev=330070&r1=330069&r2=330070&view=diff
==============================================================================
--- incubator/roller/trunk/web/errorBody.jsp (original)
+++ incubator/roller/trunk/web/errorBody.jsp Tue Nov 1 07:16:04 2005
@@ -1,5 +1,7 @@
<%@ include file="/taglibs.jsp" %>
+<% try { %>
+
<c:set var="status_code" value="${requestScope['javax.servlet.error.status_code']}" />
<c:set var="message" value="${requestScope['javax.servlet.error.message']}" />
<c:set var="type" value="${requestScope['javax.servlet.error.type']}" />
@@ -27,20 +29,28 @@
</table>
<c:if test="${!empty exception}">
- <form>
- <textarea rows="30" style="font-size:8pt;width:80%">
- <%
- java.io.StringWriter sw = new java.io.StringWriter();
- Throwable t = (Throwable)request.getAttribute("exception");
+ <%
+ java.io.StringWriter sw = new java.io.StringWriter();
+ Throwable t = (Throwable)pageContext.getAttribute("exception");
+ if (t != null) {
t.printStackTrace(new java.io.PrintWriter(sw));
+ String stackTrace = sw.toString();
+ if (stackTrace.trim().length() > 0) {
%>
- <%= sw.toString() %>
- </textarea>
- </form>
+ <p>Stack Trace:</p>
+ <form>
+ <textarea rows="30" style="font-size:8pt;width:80%">
+ <%= stackTrace %>
+ </textarea>
+ </form>
+ <% }
+ } %>
</c:if>
<br />
<br />
+
+<% } catch (Throwable t) { t.printStackTrace(); } %>