org.apache.myfaces.application
Class ViewHandlerImpl

java.lang.Object
  extended by javax.faces.application.ViewHandler
      extended by org.apache.myfaces.application.ViewHandlerImpl

public class ViewHandlerImpl
extends ViewHandler

JSF 2.0 ViewHandler implementation

Since:
2.0

Field Summary
static String FORM_STATE_MARKER
           
 
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()
           
 
Method Summary
 Locale calculateLocale(FacesContext facesContext)
          Get the locales specified as acceptable by the original request, compare them to the locales supported by this Application and return the best match.
 String calculateRenderKitId(FacesContext facesContext)
           
 UIViewRoot createView(FacesContext context, String viewId)
           
 String deriveLogicalViewId(FacesContext context, String rawViewId)
           
 String deriveViewId(FacesContext context, String input)
           
 String getActionURL(FacesContext context, String viewId)
           
 String getBookmarkableURL(FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)
           
 String getRedirectURL(FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)
           
 String getResourceURL(FacesContext facesContext, String path)
           
 ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context, String viewId)
           
static ViewHandler getViewHandler(FacesContext facesContext)
          Gets the current ViewHandler via FacesContext.getApplication().getViewHandler().
protected  ViewHandlerSupport getViewHandlerSupport()
           
protected  ViewHandlerSupport getViewHandlerSupport(FacesContext context)
           
 void initView(FacesContext context)
           
 void renderView(FacesContext context, UIViewRoot viewToRender)
           
 UIViewRoot restoreView(FacesContext context, String viewId)
           
 void setViewHandlerSupport(ViewHandlerSupport viewHandlerSupport)
           
 void writeState(FacesContext context)
           
 
Methods inherited from class javax.faces.application.ViewHandler
calculateCharacterEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORM_STATE_MARKER

public static final String FORM_STATE_MARKER
See Also:
Constant Field Values
Constructor Detail

ViewHandlerImpl

public ViewHandlerImpl()
Method Detail

getViewHandler

public static ViewHandler getViewHandler(FacesContext facesContext)
Gets the current ViewHandler via FacesContext.getApplication().getViewHandler(). We have to use this method to invoke any other specified ViewHandler-method in the code, because direct access (this.method()) will cause problems if the ViewHandler is wrapped.

Parameters:
facesContext -
Returns:

deriveViewId

public String deriveViewId(FacesContext context,
                           String input)
Overrides:
deriveViewId in class ViewHandler

deriveLogicalViewId

public String deriveLogicalViewId(FacesContext context,
                                  String rawViewId)
Overrides:
deriveLogicalViewId in class ViewHandler

getBookmarkableURL

public String getBookmarkableURL(FacesContext context,
                                 String viewId,
                                 Map<String,List<String>> parameters,
                                 boolean includeViewParams)
Overrides:
getBookmarkableURL in class ViewHandler

getRedirectURL

public String getRedirectURL(FacesContext context,
                             String viewId,
                             Map<String,List<String>> parameters,
                             boolean includeViewParams)
Overrides:
getRedirectURL in class ViewHandler

getViewDeclarationLanguage

public ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context,
                                                          String viewId)
Overrides:
getViewDeclarationLanguage in class ViewHandler

initView

public void initView(FacesContext context)
              throws FacesException
Overrides:
initView in class ViewHandler
Throws:
FacesException

calculateLocale

public Locale calculateLocale(FacesContext facesContext)
Get the locales specified as acceptable by the original request, compare them to the locales supported by this Application and return the best match.

Specified by:
calculateLocale in class ViewHandler

calculateRenderKitId

public String calculateRenderKitId(FacesContext facesContext)
Specified by:
calculateRenderKitId in class ViewHandler

createView

public UIViewRoot createView(FacesContext context,
                             String viewId)
Specified by:
createView in class ViewHandler

getActionURL

public String getActionURL(FacesContext context,
                           String viewId)
Specified by:
getActionURL in class ViewHandler

getResourceURL

public String getResourceURL(FacesContext facesContext,
                             String path)
Specified by:
getResourceURL in class ViewHandler

renderView

public void renderView(FacesContext context,
                       UIViewRoot viewToRender)
                throws IOException,
                       FacesException
Specified by:
renderView in class ViewHandler
Throws:
IOException
FacesException

restoreView

public UIViewRoot restoreView(FacesContext context,
                              String viewId)
Specified by:
restoreView in class ViewHandler

writeState

public void writeState(FacesContext context)
                throws IOException
Specified by:
writeState in class ViewHandler
Throws:
IOException

setViewHandlerSupport

public void setViewHandlerSupport(ViewHandlerSupport viewHandlerSupport)

getViewHandlerSupport

protected ViewHandlerSupport getViewHandlerSupport()

getViewHandlerSupport

protected ViewHandlerSupport getViewHandlerSupport(FacesContext context)


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.