com.liferay.faces.bridge.application
Class ViewHandlerImpl

java.lang.Object
  extended by javax.faces.application.ViewHandler
      extended by javax.faces.application.ViewHandlerWrapper
          extended by com.liferay.faces.bridge.application.ViewHandlerCompatImpl
              extended by com.liferay.faces.bridge.application.ViewHandlerImpl
All Implemented Interfaces:
javax.faces.FacesWrapper<javax.faces.application.ViewHandler>

public class ViewHandlerImpl
extends ViewHandlerCompatImpl

Author:
Neil Griffin

Field Summary
 
Fields inherited from class com.liferay.faces.bridge.application.ViewHandlerCompatImpl
RESPONSE_CHARACTER_ENCODING
 
Fields inherited from class javax.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_FACELETS_SUFFIX, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME, FACELETS_SUFFIX_PARAM_NAME, FACELETS_VIEW_MAPPINGS_PARAM_NAME
 
Constructor Summary
ViewHandlerImpl(javax.faces.application.ViewHandler viewHandler)
           
 
Method Summary
 javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext facesContext, String viewId)
          The purpose of overriding this method is to work-around a problem in the Mojarra com.sun.faces.application.view.MultiViewHanderl#derivePhysicalViewId(FacesContext, String, boolean) method.
 String getActionURL(javax.faces.context.FacesContext facesContext, String viewId)
          The purpose of this method is to provide a workaround for an incompatibility with the Mojarra implementation of JSF.
 javax.faces.application.ViewHandler getWrapped()
           
 javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext facesContext, String viewId)
           
 
Methods inherited from class com.liferay.faces.bridge.application.ViewHandlerCompatImpl
evaluateExpressionJSF1, getRedirectURL, renderView
 
Methods inherited from class javax.faces.application.ViewHandlerWrapper
calculateCharacterEncoding, calculateLocale, calculateRenderKitId, deriveLogicalViewId, deriveViewId, getBookmarkableURL, getResourceURL, getViewDeclarationLanguage, initView, writeState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewHandlerImpl

public ViewHandlerImpl(javax.faces.application.ViewHandler viewHandler)
Method Detail

createView

public javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext facesContext,
                                                   String viewId)
The purpose of overriding this method is to work-around a problem in the Mojarra com.sun.faces.application.view.MultiViewHanderl#derivePhysicalViewId(FacesContext, String, boolean) method. Specifically, the method does not expect a query-string (like ?javax.portlet.faces.PortletMode=edit) in the viewId. This is expected actually, because the JSF spec does not provide for query-strings. However, it is indeed a Bridge Spec feature. This method temporarily removes the query-string before asking Mojarra to create the view, and then adds it back.

Overrides:
createView in class javax.faces.application.ViewHandlerWrapper

restoreView

public javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext facesContext,
                                                    String viewId)
Overrides:
restoreView in class javax.faces.application.ViewHandlerWrapper

getActionURL

public String getActionURL(javax.faces.context.FacesContext facesContext,
                           String viewId)
The purpose of this method is to provide a workaround for an incompatibility with the Mojarra implementation of JSF. Specifically, the Mojarra com.sun.faces.application.view.MultiViewHandler#getActionURL(FacesContext, String) method does not properly handle viewId values that contain dot characters as part of the query-string. For example, if the specified viewId is "/view.xhtml?javax.portlet.faces.PortletMode=edit" then Mojarra will think the filename extension is ".PortletMode" instead of ".xhtml". This method works around the problem by temporarily substituting all dot characters in the viewId query-string with a token before delegating to the Mojarra method. After delegation, the dot characters are replaced.

Overrides:
getActionURL 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


Copyright © 2014 Liferay, Inc.. All Rights Reserved.