Author: chris.laprun(a)jboss.com
Date: 2010-10-18 08:09:28 -0400 (Mon, 18 Oct 2010)
New Revision: 4709
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/common/template.xhtml
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPExceptionFactory.java
Log:
- Try to be smarter with exceptions display and show more details. It's unfortunate
that JSF default renderer does not identify the detail part of the message so that
progressive disclosure could be used. :(
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java 2010-10-18
11:59:22 UTC (rev 4708)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java 2010-10-18
12:09:28 UTC (rev 4709)
@@ -62,7 +62,7 @@
protected void createMessage(String target, String message, Object severity, Object...
additionalParams)
{
- outputMessage(target, message, severity);
+ outputMessage(target, message, severity, additionalParams);
}
public static void outputMessage(String target, String message, Object severity,
Object... additionalParams)
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/common/template.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/common/template.xhtml 2010-10-18
11:59:22 UTC (rev 4708)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/common/template.xhtml 2010-10-18
12:09:28 UTC (rev 4709)
@@ -42,7 +42,7 @@
<div class="tab-container">
<!-- Status message -->
<h:messages id="status"
infoClass="portlet-msg-success" errorClass="portlet-msg-error"
- fatalClass="portlet-msg-error"
warnClass="portlet-msg-warn"/>
+ fatalClass="portlet-msg-error"
warnClass="portlet-msg-warn" showDetail="true"/>
<div style="width:98%;margin: 0 auto">
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPExceptionFactory.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPExceptionFactory.java 2010-10-18
11:59:22 UTC (rev 4708)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPExceptionFactory.java 2010-10-18
12:09:28 UTC (rev 4709)
@@ -23,6 +23,7 @@
package org.gatein.wsrp;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.slf4j.Logger;
@@ -76,6 +77,7 @@
protected abstract static class ExceptionFactory<E extends Exception>
{
+ private static final String CAUSE = " Cause: ";
private final Constructor<E> exceptionConstructor;
protected Object fault;
private static final String FAULT = "Fault";
@@ -94,6 +96,14 @@
{
try
{
+ if (cause != null)
+ {
+ String causeMsg = cause.getLocalizedMessage();
+ if (!ParameterValidation.isNullOrEmpty(causeMsg) &&
!message.contains(CAUSE))
+ {
+ message += CAUSE + causeMsg;
+ }
+ }
return exceptionConstructor.newInstance(message, fault, cause);
}
catch (Exception e)
Show replies by date