org.jboss.weld.jsf
Class ConversationAwareViewHandler

java.lang.Object
  extended by javax.faces.application.ViewHandler
      extended by javax.faces.application.ViewHandlerWrapper
          extended by org.jboss.weld.jsf.ConversationAwareViewHandler

public class ConversationAwareViewHandler
extends javax.faces.application.ViewHandlerWrapper

A forwarding JSF ViewHandler implementation that produces URLs containing the conversation id query string parameter. All methods except those which produce a URL that need to be enhanced are forwarded to the ViewHandler delegate.

A request parameter was choosen to propagate the conversation because it's the most technology agnostic approach for passing data between requests and allows for the ensuing request to use whatever means necessary (a servlet filter, phase listener, etc) to capture the conversation id and restore the long-running conversation.

QUESTION should we do the same for getResourceURL? TODO we should enable a way to disable conversation propagation by URL

Author:
Dan Allen

Field Summary
 
Fields inherited from class javax.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME
 
Constructor Summary
ConversationAwareViewHandler(javax.faces.application.ViewHandler delegate)
           
 
Method Summary
 java.lang.String getActionURL(javax.faces.context.FacesContext context, java.lang.String viewId)
          Allow the delegate to produce the action URL.
 javax.faces.application.ViewHandler getWrapped()
           
 
Methods inherited from class javax.faces.application.ViewHandlerWrapper
calculateCharacterEncoding, calculateLocale, calculateRenderKitId, createView, getResourceURL, initView, renderView, restoreView, writeState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversationAwareViewHandler

public ConversationAwareViewHandler(javax.faces.application.ViewHandler delegate)
Method Detail

getActionURL

public java.lang.String getActionURL(javax.faces.context.FacesContext context,
                                     java.lang.String viewId)
Allow the delegate to produce the action URL. If the conversation is long-running, append the conversation id request parameter to the query string part of the URL, but only if the request parameter is not already present. This covers all cases: form actions, link hrefs, Ajax calls, and redirect URLs.

Overrides:
getActionURL in class javax.faces.application.ViewHandlerWrapper
See Also:
ViewHandler#getActionURL(FacesContext, String)}

getWrapped

public javax.faces.application.ViewHandler getWrapped()
Specified by:
getWrapped in class javax.faces.application.ViewHandlerWrapper
See Also:
ViewHandlerWrapper#getWrapped()}


Copyright © 2008-2009 Seam Framework. All Rights Reserved.