Some more improvements to the exception report page
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/fa691e26 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/fa691e26 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/fa691e26 Branch: refs/heads/master Commit: fa691e262a35b36cd8de25b2dc7269f9566f1db9 Parents: ede56bc Author: Howard M. Lewis Ship <hls...@apache.org> Authored: Wed Dec 31 16:55:15 2014 -0800 Committer: Howard M. Lewis Ship <hls...@apache.org> Committed: Wed Dec 31 16:55:15 2014 -0800 ---------------------------------------------------------------------- .../corelib/pages/ExceptionReport.java | 14 +++++++++- .../tapestry5/corelib/pages/ExceptionReport.tml | 27 +++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fa691e26/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 8bdaf9e..248b347 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 @@ -132,9 +132,21 @@ public class ExceptionReport extends AbstractInternalPage implements ExceptionRe private final String pathSeparator = System.getProperty(PATH_SEPARATOR_PROPERTY); + /** + * Returns true for normal, non-XHR requests. Links (to the failure page, or to root page) are only + * presented if showActions is true. + */ public boolean isShowActions() { - return ! productionMode && failurePage != null && !request.isXHR(); + return !request.isXHR(); + } + + /** + * Returns true in development mode; enables the "with reload" actions. + */ + public boolean isShowReload() + { + return !productionMode; } public void reportException(Throwable exception) http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fa691e26/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 0f6dbac..74cdc1e 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 @@ -41,28 +41,31 @@ <div class="panel-footer"> <div class="btn-toolbar btn-group-xs"> - <t:if test="failurePage"> <t:pagelink page="prop:failurePage" class="btn btn-default">Go to page <strong>${failurePage}</strong> </t:pagelink> - <t:actionlink t:id="reloadFirst" parameters="{'loadPage': failurePage}" - context="reloadContext" class="btn btn-default">Go to page - <strong>${failurePage}</strong> - (with reload) - </t:actionlink> + <t:if test="showReload"> + <t:actionlink t:id="reloadFirst" parameters="{'loadPage': failurePage}" + context="reloadContext" class="btn btn-default">Go to page + <strong>${failurePage}</strong> + (with reload) + </t:actionlink> + </t:if> </t:if> <a href="/" class="btn btn-default">Go to <strong>${rootURL}</strong> </a> - <t:actionLink t:id="reloadRoot" class="btn btn-default"> - Go to - <strong>${rootURL}</strong> - (with reload) - </t:actionLink> + <t:if test="showReload"> + <t:actionLink t:id="reloadRoot" class="btn btn-default"> + Go to + <strong>${rootURL}</strong> + (with reload) + </t:actionLink> + </t:if> </div> </div> - <t:if test="showActions"> + <t:if test="showReload"> <div class="panel-footer"> <p><strong>with reload</strong>: Force a reload of component classes. This is often necessary