org.apache.struts.faces.application
Class ViewHandlerImpl

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

public class ViewHandlerImpl
extends javax.faces.application.ViewHandler

Custom ViewHandler implementation that adds features specific to the Struts-Faces Integration Library. It leverages the "decorator pattern" customization strategy that JSF supports, by delegating most processing to the ViewHandler instance handed to our constructor.


Field Summary
 
Fields inherited from class javax.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME
 
Constructor Summary
ViewHandlerImpl(javax.faces.application.ViewHandler handler)
          Construct a ViewHandlerImpl decorating the specified ViewHandler instance.
 
Method Summary
 java.util.Locale calculateLocale(javax.faces.context.FacesContext context)
           
 java.lang.String calculateRenderKitId(javax.faces.context.FacesContext context)
           
 javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext context, java.lang.String viewId)
           
 java.lang.String getActionURL(javax.faces.context.FacesContext context, java.lang.String viewId)
           
 javax.faces.application.ViewHandler getHandler()
          Return the ViewHandler instance we are decorating.
 java.lang.String getResourceURL(javax.faces.context.FacesContext context, java.lang.String viewId)
           
 void renderView(javax.faces.context.FacesContext context, javax.faces.component.UIViewRoot view)
          If the Struts application has set a Locale, pass it on to JSF prior to delegating the actual rendering.
 javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext context, java.lang.String viewId)
           
 void setHandler(javax.faces.application.ViewHandler handler)
          Set the ViewHandler instance we are decorating.
 void writeState(javax.faces.context.FacesContext context)
           
 
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 handler)

Construct a ViewHandlerImpl decorating the specified ViewHandler instance.

Parameters:
handler - ViewHandler to be decorated
Method Detail

getHandler

public javax.faces.application.ViewHandler getHandler()

Return the ViewHandler instance we are decorating.


setHandler

public void setHandler(javax.faces.application.ViewHandler handler)

Set the ViewHandler instance we are decorating.

Parameters:
handler - ViewHandler instance to decorate

renderView

public void renderView(javax.faces.context.FacesContext context,
                       javax.faces.component.UIViewRoot view)
                throws java.io.IOException,
                       javax.faces.FacesException

If the Struts application has set a Locale, pass it on to JSF prior to delegating the actual rendering.

Specified by:
renderView in class javax.faces.application.ViewHandler
Parameters:
context - FacesContext for the current request
view - UIViewRoot to be rendered
Throws:
java.io.IOException
javax.faces.FacesException

calculateLocale

public java.util.Locale calculateLocale(javax.faces.context.FacesContext context)
Specified by:
calculateLocale in class javax.faces.application.ViewHandler

calculateRenderKitId

public java.lang.String calculateRenderKitId(javax.faces.context.FacesContext context)
Specified by:
calculateRenderKitId in class javax.faces.application.ViewHandler

createView

public javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext context,
                                                   java.lang.String viewId)
Specified by:
createView in class javax.faces.application.ViewHandler

getActionURL

public java.lang.String getActionURL(javax.faces.context.FacesContext context,
                                     java.lang.String viewId)
Specified by:
getActionURL in class javax.faces.application.ViewHandler

getResourceURL

public java.lang.String getResourceURL(javax.faces.context.FacesContext context,
                                       java.lang.String viewId)
Specified by:
getResourceURL in class javax.faces.application.ViewHandler

restoreView

public javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext context,
                                                    java.lang.String viewId)
Specified by:
restoreView in class javax.faces.application.ViewHandler

writeState

public void writeState(javax.faces.context.FacesContext context)
                throws java.io.IOException
Specified by:
writeState in class javax.faces.application.ViewHandler
Throws:
java.io.IOException


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.