roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r330070 - /incubator/roller/trunk/web/errorBody.jsp
Date Tue, 01 Nov 2005 15:16:08 GMT
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(); } %>
 
 
 



Mime
View raw message