You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2012/11/03 02:06:55 UTC
git commit: Rebuild the ExceptionReport page and ExceptionDisplay
component
Updated Branches:
refs/heads/5.4-js-rewrite 4936ee3e3 -> c8260a440
Rebuild the ExceptionReport page and ExceptionDisplay component
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/c8260a44
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/c8260a44
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/c8260a44
Branch: refs/heads/5.4-js-rewrite
Commit: c8260a440aa5741af0675f046cd848c6bc79f036
Parents: 4936ee3
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Fri Nov 2 18:06:49 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Fri Nov 2 18:06:49 2012 -0700
----------------------------------------------------------------------
.../corelib/components/ExceptionDisplay.java | 19 +--
.../tapestry5/corelib/components/RenderObject.java | 4 +-
.../tapestry5/corelib/pages/ExceptionReport.java | 4 +-
.../META-INF/assets/core/ExceptionDisplay.css | 18 ++
.../META-INF/assets/core/ExceptionReport.css | 3 +
.../META-INF/assets/core/RenderObject.css | 29 ++++
.../corelib/components/ExceptionDisplay.tml | 56 ++++---
.../tapestry5/corelib/pages/ExceptionReport.tml | 129 ++++++++-------
8 files changed, 164 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
index 7a00037..af41b38 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
@@ -1,4 +1,4 @@
-// Copyright 2008, 2009, 2010, 2011 The Apache Software Foundation
+// Copyright 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,6 @@
package org.apache.tapestry5.corelib.components;
-import java.util.List;
-
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
@@ -29,6 +27,8 @@ import org.apache.tapestry5.services.StackTraceElementAnalyzer;
import org.apache.tapestry5.services.StackTraceElementClassConstants;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
+import java.util.List;
+
/**
* Integral part of the default {@link org.apache.tapestry5.corelib.pages.ExceptionReport} page used to break apart and
* display the properties of the exception.
@@ -36,7 +36,7 @@ import org.apache.tapestry5.services.javascript.JavaScriptSupport;
* @see org.apache.tapestry5.ioc.services.ExceptionAnalyzer
* @tapestrydoc
*/
-@Import(library = "exceptiondisplay.js")
+@Import(stylesheet = "ExceptionDisplay.css")
public class ExceptionDisplay
{
/**
@@ -81,13 +81,6 @@ public class ExceptionDisplay
toggleId = jsSupport.allocateClientId("toggleStack");
}
- public boolean getShowPropertyList()
- {
- // True if either is non-empty
-
- return !(info.getPropertyNames().isEmpty() && info.getStackTrace().isEmpty());
- }
-
public Object getPropertyValue()
{
return info.getProperty(propertyName);
@@ -96,7 +89,9 @@ public class ExceptionDisplay
public String getFrameClass()
{
if (sawDoFilter)
+ {
return StackTraceElementClassConstants.OMITTED;
+ }
String result = frameAnalyzer.classForFrame(frame);
@@ -107,6 +102,6 @@ public class ExceptionDisplay
void afterRender()
{
- jsSupport.addScript("Tapestry.stackFrameToggle('%s');", toggleId);
+ // jsSupport.addScript("Tapestry.stackFrameToggle('%s');", toggleId);
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/RenderObject.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/RenderObject.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/RenderObject.java
index efb9d3a..bb1a50c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/RenderObject.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/RenderObject.java
@@ -1,4 +1,4 @@
-// Copyright 2007, 2011 The Apache Software Foundation
+// Copyright 2007, 2011, 2012 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
package org.apache.tapestry5.corelib.components;
import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.corelib.pages.ExceptionReport;
import org.apache.tapestry5.ioc.annotations.Inject;
@@ -29,6 +30,7 @@ import org.apache.tapestry5.services.ObjectRenderer;
*
* @tapestrydoc
*/
+@Import(stylesheet = "RenderObject.css")
public class RenderObject
{
@Parameter(required = true)
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ExceptionReport.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ExceptionReport.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ExceptionReport.java
index 497b521..954d4db 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ExceptionReport.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ExceptionReport.java
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2012 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ package org.apache.tapestry5.corelib.pages;
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.annotations.ContentType;
+import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.annotations.Symbol;
@@ -34,6 +35,7 @@ import java.util.regex.Pattern;
* @see org.apache.tapestry5.corelib.components.ExceptionDisplay
*/
@ContentType("text/html")
+@Import(stack = "core", stylesheet = "ExceptionReport.css")
public class ExceptionReport implements ExceptionReporter
{
private static final String PATH_SEPARATOR_PROPERTY = "path.separator";
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css b/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
new file mode 100644
index 0000000..8addb02
--- /dev/null
+++ b/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
@@ -0,0 +1,18 @@
+UL.t-stack-trace LI {
+ font-size: small;
+}
+
+LI.t-usercode-frame {
+ font-weight: bold;
+ color: blue;
+}
+
+LI.t-omitted-frame {
+ display: none;
+ color: gray;
+ list-style: square;
+}
+
+DT:after {
+ content: ":";
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionReport.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionReport.css b/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionReport.css
new file mode 100644
index 0000000..aad500b
--- /dev/null
+++ b/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionReport.css
@@ -0,0 +1,3 @@
+body {
+ padding-top: 45px;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/resources/META-INF/assets/core/RenderObject.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/RenderObject.css b/tapestry-core/src/main/resources/META-INF/assets/core/RenderObject.css
new file mode 100644
index 0000000..b899636
--- /dev/null
+++ b/tapestry-core/src/main/resources/META-INF/assets/core/RenderObject.css
@@ -0,0 +1,29 @@
+TABLE.t-location-outer {
+ padding: 5px;
+ border-collapse: collapse;
+ border: 1px solid black;
+ width: 100%;
+}
+
+TD.t-location-line {
+ width: 40px;
+ text-align: right;
+ padding: 0px;
+ background-color: #E1E1E1;
+ padding-right: 3px;
+ border-right: 1px solid black;
+}
+
+TD.t-location-content {
+ border-top: 1px solid silver;
+ border-right: 1px solid black;
+ white-space: pre;
+}
+
+TD.t-location-current {
+ background-color: #FFFFCF;
+}
+
+TD.t-location-content-first {
+ border-top: 1px solid black;
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
index 14ecd0e..c0547c1 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
@@ -1,36 +1,40 @@
-<div xml:space="default" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" class="t-exception-report">
- <ul>
- <t:loop source="stack" value="info">
- <li>
- <span class="t-exception-class-name">${info.className}</span>
+<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+ <t:loop source="stack" value="info">
- <div t:type="if" test="info.message" class="t-exception-message">${info.message}</div>
+ <div class="well">
+ <h3>${info.className}</h3>
- <dl t:type="if" test="showPropertyList">
+ <t:if test="info.message">
+ <p><strong>${info.message}</strong></p>
+ </t:if>
+
+ <t:if test="info.propertyNames">
+ <dl>
<t:loop source="info.propertyNames" value="propertyName">
<dt>${propertyName}</dt>
<dd>
<t:renderobject object="propertyValue"/>
</dd>
</t:loop>
- <t:if test="info.stackTrace">
- <dt>
- <span class="t-exception-stack-controls">
- <input type="checkbox" id="${toggleId}" checked="checked"/>
- <label for="${toggleId}">Filter stack frames</label>
- </span>
- Stack trace
- </dt>
- <dd>
- <ul class="t-stack-trace">
- <li t:type="loop" source="info.stackTrace" value="frame" class="${frameClass}">
- ${frame}
- </li>
- </ul>
- </dd>
- </t:if>
</dl>
- </li>
- </t:loop>
- </ul>
+ </t:if>
+
+ </div>
+
+ <t:if test="info.stackTrace">
+ <div>
+ <form action="#" class="form-inline pull-right">
+ <label class="checkbox">
+ <input type="checkbox" data-behavior="master" checked="true"/> Filter Frames?
+ </label>
+ </form>
+ <h4>Stack trace:</h4>
+ </div>
+ <ul class="t-stack-trace">
+ <li t:type="loop" source="info.stackTrace" value="frame" class="${frameClass}">
+ ${frame}
+ </li>
+ </ul>
+ </t:if>
+ </t:loop>
</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c8260a44/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
index 19c9ff2..7a13a32 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
@@ -1,62 +1,75 @@
-<html xml:space="default" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" xmlns:p="tapestry:parameter">
- <head>
- <title>Application Exception</title>
- </head>
- <body>
- <h1 class="t-exception-report">An unexpected application exception has occurred.</h1>
-
- <t:if test="productionMode">
- <p>${rootException.message}</p>
- <p:else>
- <t:exceptiondisplay exception="rootException"/>
-
- <div class="t-env-data">
-
- <h2>Tapestry Framework</h2>
- <dl>
- <dt>Tapestry Version</dt>
- <dd>${tapestryVersion}</dd>
- <dt>Application Version</dt>
- <dd>${applicationVersion}</dd>
- </dl>
-
- <h2>Request</h2>
- <t:renderobject object="request"/>
-
- <t:if test="hasSession">
- <h2>Session</h2>
- <dl>
- <t:loop source="session.attributeNames" value="attributeName">
- <dt>${attributeName}</dt>
- <dd>
- <t:renderobject object="attributeValue"/>
- </dd>
- </t:loop>
- </dl>
- </t:if>
+<html xml:space="default" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+<head>
+ <title>Application Exception</title>
+</head>
+<body>
+<div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+
+ <ul class="nav">
+ <li class="navbar-text">
+ <h4>Application Exception</h4>
+ </li>
+ <li class="divider-vertical"/>
+ <li class="navbar-text">
+ Tapestry Version: ${tapestryVersion}
+ </li>
+ <li class="divider-vertical"/>
+ <li class="navbar-text">
+ Application Version: ${applicationVersion}
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<div class="container">
+
+ <div class="alert alert-error">
+ <h2>An exception has occurred processing this request.</h2>
+
+ <p>${rootException.message}</p>
+ </div>
+
+ <t:if test="! productionMode">
- <h2>System Properties</h2>
- <dl>
- <t:loop source="systemProperties" value="propertyName">
- <dt>${propertyName}</dt>
- <dd>
- <t:if test="! complexProperty">
- ${propertyValue}
- <p:else>
- <ul>
- <li t:type="loop" source="complexPropertyValue" value="var:path">
- ${var:path}
- </li>
- </ul>
- </p:else>
- </t:if>
- </dd>
- </t:loop>
- </dl>
-
- </div>
- </p:else>
+ <t:exceptiondisplay exception="rootException"/>
+
+ <h3>Request</h3>
+ <t:renderobject object="request"/>
+
+ <t:if test="hasSession">
+ <h2>Session</h2>
+ <dl>
+ <t:loop source="session.attributeNames" value="attributeName">
+ <dt>${attributeName}</dt>
+ <dd>
+ <t:renderobject object="attributeValue"/>
+ </dd>
+ </t:loop>
+ </dl>
</t:if>
- </body>
+
+ <h3>System Properties</h3>
+ <dl>
+ <t:loop source="systemProperties" value="propertyName">
+ <dt>${propertyName}</dt>
+ <dd>
+ <t:if test="! complexProperty">
+ ${propertyValue}
+ <p:else>
+ <ul>
+ <li t:type="loop" source="complexPropertyValue" value="var:path">
+ ${var:path}
+ </li>
+ </ul>
+ </p:else>
+ </t:if>
+ </dd>
+ </t:loop>
+ </dl>
+ </t:if>
+</div>
+</body>
</html>