[jboss-cvs] jboss-seam/src/main/org/jboss/seam/web ...

Gavin King gavin.king at jboss.com
Thu Oct 4 21:39:39 EDT 2007


  User: gavin   
  Date: 07/10/04 21:39:39

  Modified:    src/main/org/jboss/seam/web  ExceptionFilter.java
  Log:
  Fix problem when conversation was not propagated in exception case
  
  Revision  Changes    Path
  1.26      +9 -17     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.25
  retrieving revision 1.26
  diff -u -b -r1.25 -r1.26
  --- ExceptionFilter.java	5 Oct 2007 01:11:39 -0000	1.25
  +++ ExceptionFilter.java	5 Oct 2007 01:39:39 -0000	1.26
  @@ -85,28 +85,20 @@
         facesContext.setCurrent();
         
         //if the event context was cleaned up, fish the conversation id 
  -      //directly out of the ServletRequest attributes
  -      String conversationId = null;
  -      if ( !Contexts.isEventContextActive() )
  -      {
  -         Manager oldManager =  (Manager) request.getAttribute( Seam.getComponentName(Manager.class) );
  -         if (oldManager != null) conversationId = oldManager.getCurrentConversationId(); 
  -      }
  +      //directly out of the ServletRequest attributes, else get it from
  +      //the event context
  +      Manager manager = Contexts.isEventContextActive() ?
  +              (Manager) Contexts.getEventContext().get(Manager.class) :
  +              (Manager) request.getAttribute( Seam.getComponentName(Manager.class) );
  +      String conversationId = manager==null ? null : manager.getCurrentConversationId();
         
         //Initialize the temporary context objects
         FacesLifecycle.beginExceptionRecovery( facesContext.getExternalContext() );
         
         //If there is an existing long-running conversation on
  -      //the failed request, propagate it, otherwise initialize a temporary conversation      
  -      if (conversationId != null)
  -      {
  +      //the failed request, propagate it
            ConversationPropagation.instance().setConversationId(conversationId);
            Manager.instance().restoreConversation();         
  -      }
  -      else
  -      {
  -         Manager.instance().initializeTemporaryConversation();
  -      }
         
         //Now do the exception handling
         try
  
  
  



More information about the jboss-cvs-commits mailing list