Class ConversationAwareViewHandler

  • All Implemented Interfaces:
    javax.faces.FacesWrapper<javax.faces.application.ViewHandler>

    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 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 Detail

      • ConversationAwareViewHandler

        public ConversationAwareViewHandler​(javax.faces.application.ViewHandler delegate)
    • 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:
        getActionURL in class javax.faces.application.ViewHandlerWrapper
      • getBookmarkableURL

        public String getBookmarkableURL​(javax.faces.context.FacesContext context,
                                         String viewId,
                                         Map<String,​List<String>> parameters,
                                         boolean includeViewParams)
        Overrides:
        getBookmarkableURL in class javax.faces.application.ViewHandlerWrapper
      • getRedirectURL

        public String getRedirectURL​(javax.faces.context.FacesContext context,
                                     String viewId,
                                     Map<String,​List<String>> parameters,
                                     boolean includeViewParams)
        Overrides:
        getRedirectURL in class javax.faces.application.ViewHandlerWrapper
      • getResourceURL

        public String getResourceURL​(javax.faces.context.FacesContext context,
                                     String path)
        Overrides:
        getResourceURL in class javax.faces.application.ViewHandlerWrapper
      • getWrapped

        public javax.faces.application.ViewHandler getWrapped()
        Specified by:
        getWrapped in interface javax.faces.FacesWrapper<javax.faces.application.ViewHandler>
        Overrides:
        getWrapped in class javax.faces.application.ViewHandlerWrapper