Package org.jboss.weld.module.jsf
Class ConversationAwareViewHandler
- java.lang.Object
-
- javax.faces.application.ViewHandler
-
- javax.faces.application.ViewHandlerWrapper
-
- org.jboss.weld.module.jsf.ConversationAwareViewHandler
-
- All Implemented Interfaces:
javax.faces.FacesWrapper<javax.faces.application.ViewHandler>
public class ConversationAwareViewHandler extends javax.faces.application.ViewHandlerWrapperA 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 chosen 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.
- Author:
- Dan Allen, Pete Muir, Ales Justin, Marko Luksa
-
-
Field Summary
-
Fields inherited from class javax.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_FACELETS_SUFFIX, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME, DISABLE_FACELET_JSF_VIEWHANDLER_PARAM_NAME, FACELETS_BUFFER_SIZE_PARAM_NAME, FACELETS_DECORATORS_PARAM_NAME, FACELETS_LIBRARIES_PARAM_NAME, FACELETS_REFRESH_PERIOD_PARAM_NAME, FACELETS_SKIP_COMMENTS_PARAM_NAME, FACELETS_SUFFIX_PARAM_NAME, FACELETS_VIEW_MAPPINGS_PARAM_NAME
-
-
Constructor Summary
Constructors Constructor Description ConversationAwareViewHandler(javax.faces.application.ViewHandler delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActionURL(javax.faces.context.FacesContext facesContext, String viewId)Allow the delegate to produce the action URL.StringgetBookmarkableURL(javax.faces.context.FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)StringgetRedirectURL(javax.faces.context.FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)StringgetResourceURL(javax.faces.context.FacesContext context, String path)javax.faces.application.ViewHandlergetWrapped()-
Methods inherited from class javax.faces.application.ViewHandlerWrapper
addProtectedView, calculateCharacterEncoding, calculateLocale, calculateRenderKitId, createView, deriveLogicalViewId, deriveViewId, getProtectedViewsUnmodifiable, getViewDeclarationLanguage, getViews, getViews, getWebsocketURL, initView, removeProtectedView, renderView, restoreView, writeState
-
-
-
-
Method Detail
-
getActionURL
public String getActionURL(javax.faces.context.FacesContext facesContext, 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 form actions Ajax calls, and redirect URLs (which we want) and link hrefs (which we don't)- Overrides:
getActionURLin classjavax.faces.application.ViewHandlerWrapper
-
getBookmarkableURL
public String getBookmarkableURL(javax.faces.context.FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)
- Overrides:
getBookmarkableURLin classjavax.faces.application.ViewHandlerWrapper
-
getRedirectURL
public String getRedirectURL(javax.faces.context.FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)
- Overrides:
getRedirectURLin classjavax.faces.application.ViewHandlerWrapper
-
getResourceURL
public String getResourceURL(javax.faces.context.FacesContext context, String path)
- Overrides:
getResourceURLin classjavax.faces.application.ViewHandlerWrapper
-
getWrapped
public javax.faces.application.ViewHandler getWrapped()
- Specified by:
getWrappedin interfacejavax.faces.FacesWrapper<javax.faces.application.ViewHandler>- Overrides:
getWrappedin classjavax.faces.application.ViewHandlerWrapper
-
-