Seam Core JSF2 2.3.1.Final

org.jboss.seam.jsf
Class SeamViewHandler

java.lang.Object
  extended by javax.faces.application.ViewHandler
      extended by javax.faces.application.ViewHandlerWrapper
          extended by org.jboss.seam.jsf.SeamViewHandler
All Implemented Interfaces:
javax.faces.FacesWrapper<javax.faces.application.ViewHandler>

public class SeamViewHandler
extends javax.faces.application.ViewHandlerWrapper

Allows the JSF view locale to be integrated with the locale coming from Seam internationalization.

Author:
Gavin King
See Also:
LocaleSelector

Field Summary
 
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
SeamViewHandler(javax.faces.application.ViewHandler viewHandler)
           
 
Method Summary
 String calculateCharacterEncoding(javax.faces.context.FacesContext context)
           
 Locale calculateLocale(javax.faces.context.FacesContext facesContext)
           
 String calculateRenderKitId(javax.faces.context.FacesContext ctx)
           
 javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext ctx, String viewId)
           
 String getActionURL(javax.faces.context.FacesContext facesContext, String viewId)
          Allow the delegate to produce the action URL.
 String getBookmarkableURL(javax.faces.context.FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)
           
 String getRedirectURL(javax.faces.context.FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)
           
 String getResourceURL(javax.faces.context.FacesContext ctx, String path)
           
 javax.faces.application.ViewHandler getWrapped()
           
 void initView(javax.faces.context.FacesContext context)
           
 void renderView(javax.faces.context.FacesContext ctx, javax.faces.component.UIViewRoot viewRoot)
           
 javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext ctx, String viewId)
           
 void writeState(javax.faces.context.FacesContext ctx)
           
 
Methods inherited from class javax.faces.application.ViewHandlerWrapper
deriveLogicalViewId, deriveViewId, getViewDeclarationLanguage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeamViewHandler

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

calculateCharacterEncoding

public String calculateCharacterEncoding(javax.faces.context.FacesContext context)
Overrides:
calculateCharacterEncoding in class javax.faces.application.ViewHandlerWrapper

initView

public void initView(javax.faces.context.FacesContext context)
              throws javax.faces.FacesException
Overrides:
initView in class javax.faces.application.ViewHandlerWrapper
Throws:
javax.faces.FacesException

calculateLocale

public Locale calculateLocale(javax.faces.context.FacesContext facesContext)
Overrides:
calculateLocale in class javax.faces.application.ViewHandlerWrapper

calculateRenderKitId

public String calculateRenderKitId(javax.faces.context.FacesContext ctx)
Overrides:
calculateRenderKitId in class javax.faces.application.ViewHandlerWrapper

createView

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

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
See Also:
ViewHandler#getActionURL(FacesContext, String)}

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

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

getResourceURL

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

renderView

public void renderView(javax.faces.context.FacesContext ctx,
                       javax.faces.component.UIViewRoot viewRoot)
                throws IOException,
                       javax.faces.FacesException
Overrides:
renderView in class javax.faces.application.ViewHandlerWrapper
Throws:
IOException
javax.faces.FacesException

restoreView

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

writeState

public void writeState(javax.faces.context.FacesContext ctx)
                throws IOException
Overrides:
writeState in class javax.faces.application.ViewHandlerWrapper
Throws:
IOException

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

Seam Core JSF2 2.3.1.Final

Copyright © 2013 Seam Framework. All Rights Reserved.