[jboss-cvs] jboss-seam/src/main/org/jboss/seam/exceptions ...
Gavin King
gavin.king at jboss.com
Sun Feb 4 00:41:58 EST 2007
User: gavin
Date: 07/02/04 00:41:58
Modified: src/main/org/jboss/seam/exceptions
AnnotationErrorHandler.java
AnnotationRedirectHandler.java
DebugPageHandler.java ErrorHandler.java
RedirectHandler.java
Log:
fixes
Revision Changes Path
1.3 +0 -5 jboss-seam/src/main/org/jboss/seam/exceptions/AnnotationErrorHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AnnotationErrorHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/AnnotationErrorHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- AnnotationErrorHandler.java 4 Feb 2007 01:13:19 -0000 1.2
+++ AnnotationErrorHandler.java 4 Feb 2007 05:41:58 -0000 1.3
@@ -36,9 +36,4 @@
return e.getClass().getAnnotation(HttpError.class).rollback();
}
- @Override
- public String toString()
- {
- return "ErrorHandler";
- }
}
\ No newline at end of file
1.3 +0 -5 jboss-seam/src/main/org/jboss/seam/exceptions/AnnotationRedirectHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AnnotationRedirectHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/AnnotationRedirectHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- AnnotationRedirectHandler.java 4 Feb 2007 01:13:19 -0000 1.2
+++ AnnotationRedirectHandler.java 4 Feb 2007 05:41:58 -0000 1.3
@@ -36,9 +36,4 @@
return e.getClass().getAnnotation(Redirect.class).rollback();
}
- @Override
- public String toString()
- {
- return "RedirectHandler";
- }
}
\ No newline at end of file
1.5 +18 -4 jboss-seam/src/main/org/jboss/seam/exceptions/DebugPageHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DebugPageHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/DebugPageHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- DebugPageHandler.java 4 Feb 2007 02:38:29 -0000 1.4
+++ DebugPageHandler.java 4 Feb 2007 05:41:58 -0000 1.5
@@ -4,23 +4,37 @@
package org.jboss.seam.exceptions;
import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.Exceptions;
import org.jboss.seam.core.Manager;
+import org.jboss.seam.core.RedirectException;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
public class DebugPageHandler extends ExceptionHandler
{
+ private static final LogProvider log = Logging.getLogProvider(DebugPageHandler.class);
+
@Override
public void handle(Exception e) throws Exception
{
- Exceptions.log.error("redirecting to debug page", e);
+ log.error("redirecting to debug page", e);
Contexts.getConversationContext().set("org.jboss.seam.debug.lastException", e);
org.jboss.seam.core.Redirect redirect = org.jboss.seam.core.Redirect.instance();
redirect.setViewId("/debug.xhtml");
Manager manager = Manager.instance();
manager.beforeRedirect();
redirect.setParameter( manager.getConversationIdParameter(), manager.getCurrentConversationId() );
+
+ try
+ {
redirect.execute();
+ }
+ catch (RedirectException re)
+ {
+ //do nothing
+ log.debug("could not redirect", re);
+ }
+
Contexts.getConversationContext().flush();
}
@@ -33,6 +47,6 @@
@Override
public String toString()
{
- return "Debug";
+ return "DebugPageHandler";
}
}
\ No newline at end of file
1.3 +7 -3 jboss-seam/src/main/org/jboss/seam/exceptions/ErrorHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ErrorHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/ErrorHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ErrorHandler.java 4 Feb 2007 01:13:19 -0000 1.2
+++ ErrorHandler.java 4 Feb 2007 05:41:58 -0000 1.3
@@ -16,9 +16,13 @@
{
Conversation.instance().end();
}
- String message = getMessage(e);
- //addFacesMessage(e, message);
- error( getCode(e), Interpolator.instance().interpolate( getDisplayMessage(e, message) ) );
+
+ error( getCode(e), Interpolator.instance().interpolate( getDisplayMessage( e, getMessage(e) ) ) );
}
+ @Override
+ public String toString()
+ {
+ return "ErrorHandler";
+ }
}
\ No newline at end of file
1.4 +21 -2 jboss-seam/src/main/org/jboss/seam/exceptions/RedirectHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RedirectHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/RedirectHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- RedirectHandler.java 4 Feb 2007 01:13:19 -0000 1.3
+++ RedirectHandler.java 4 Feb 2007 05:41:58 -0000 1.4
@@ -3,28 +3,47 @@
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Conversation;
import org.jboss.seam.core.RedirectException;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
public abstract class RedirectHandler extends ExceptionHandler
{
+ private static final LogProvider log = Logging.getLogProvider(RedirectHandler.class);
+
protected abstract String getViewId(Exception e);
@Override
public void handle(Exception e) throws Exception
{
+ String viewId = getViewId(e);
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("redirecting to: " + viewId);
+ }
+
addFacesMessage( e, getMessage(e) );
if ( Contexts.isConversationContextActive() && isEnd(e) )
{
Conversation.instance().end();
}
+
try
{
- redirect( getViewId(e), null );
+ redirect(viewId, null);
}
catch (RedirectException re)
{
//do nothing
+ log.debug("could not redirect", re);
+ }
}
+
+ @Override
+ public String toString()
+ {
+ return "RedirectHandler";
}
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list