[jboss-cvs] jboss-seam/src/main/org/jboss/seam/web ...
Gavin King
gavin.king at jboss.com
Wed Jul 4 14:29:40 EDT 2007
User: gavin
Date: 07/07/04 14:29:39
Modified: src/main/org/jboss/seam/web ExceptionFilter.java
Log:
JBSEAM-1605
Revision Changes Path
1.21 +26 -3 jboss-seam/src/main/org/jboss/seam/web/ExceptionFilter.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ExceptionFilter.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/web/ExceptionFilter.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- ExceptionFilter.java 25 Jun 2007 22:56:50 -0000 1.20
+++ ExceptionFilter.java 4 Jul 2007 18:29:39 -0000 1.21
@@ -73,12 +73,34 @@
protected void endWebRequestAfterException(HttpServletRequest request, HttpServletResponse response, Exception e)
throws ServletException, IOException
{
- log.debug("ending request");
+ //TODO: Are we really sure that someone flushes the "old"
+ // conversation context before we get to here? I guess
+ // the phaselistener probably does it, but we want to
+ // make sure of that...
+
+ log.debug("running exception handlers");
//the FacesContext is gone - create a fake one for Redirect and HttpError to call
MockFacesContext facesContext = createFacesContext(request, response);
facesContext.setCurrent();
+
+ //Init the temp context objects
+ //TODO: note that this code is pretty dodgy since in theory
+ // Manager has already been destroyed, and now we are
+ // re-using it (and all other request-scoped objects).
+ // Should create a new request context that does not
+ // map back to the servlet request context, and "copy"
+ // the conversation id over.
FacesLifecycle.beginExceptionRecovery( facesContext.getExternalContext() );
- Manager.instance().initializeTemporaryConversation();
+
+ //if there is an existing long-running conversation on
+ //the thread, propagate it
+ Manager manager = Manager.instance();
+ if ( !manager.isLongRunningOrNestedConversation() )
+ {
+ manager.initializeTemporaryConversation();
+ }
+
+ //Now do the exception handling
try
{
rollbackTransactionIfNecessary();
@@ -98,11 +120,12 @@
}
finally
{
+ //finally, clean up the temp contexts
try
{
FacesLifecycle.endRequest( facesContext.getExternalContext() );
facesContext.release();
- log.debug("ended request");
+ log.debug("done running exception handlers");
}
catch (Exception ere)
{
More information about the jboss-cvs-commits
mailing list