Skip to content

Commit

Permalink
moved conversation setup/teardown out of jsf phase listener into serv…
Browse files Browse the repository at this point in the history
…let lifecycle (Nik says to blame me if this doesn't work ;)
  • Loading branch information
sbryzak committed Apr 1, 2010
1 parent 6942e60 commit bf10ceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
Expand Up @@ -118,7 +118,7 @@ else if (phaseEvent.getFacesContext().getResponseComplete())
private void beforeRestoreView(FacesContext facesContext)
{
log.trace(INITIATING_CONVERSATION, "Restore View");
initiateSessionAndConversation(facesContext);
//initiateSessionAndConversation(facesContext);
}

/**
Expand All @@ -127,7 +127,7 @@ private void beforeRestoreView(FacesContext facesContext)
private void afterRenderResponse(FacesContext facesContext)
{
log.trace(CLEANING_UP_CONVERSATION, "Render Response", "response complete");
getConversationManager().teardownConversation();
//getConversationManager().teardownConversation();
}

/**
Expand All @@ -136,7 +136,7 @@ private void afterRenderResponse(FacesContext facesContext)
private void afterResponseComplete(FacesContext facesContext, PhaseId phaseId)
{
log.trace(CLEANING_UP_CONVERSATION, phaseId, "the response has been marked complete");
getConversationManager().teardownConversation();
//getConversationManager().teardownConversation();
}

/**
Expand Down
Expand Up @@ -162,6 +162,7 @@ public void beginRequest(HttpServletRequest request)
request.setAttribute(REQUEST_ATTRIBUTE_NAME, beanStore);
lifecycle.beginRequest(request.getRequestURI(), beanStore);
restoreSessionContext(request);
conversationManager(request.getSession().getServletContext()).setupConversation(request.getParameter("cid"));
}
}

Expand All @@ -176,10 +177,12 @@ public void endRequest(HttpServletRequest request)
{
return;
}
teardownSession(request);

conversationManager(request.getSession().getServletContext()).teardownConversation();
teardownRequest(request);
lifecycle.getConversationContext().setBeanStore(null);
lifecycle.getConversationContext().setActive(false);
teardownSession(request);
}

private void teardownSession(HttpServletRequest request)
Expand Down

0 comments on commit bf10ceb

Please sign in to comment.