Package org.apache.myfaces.view.jsp
Class JspViewDeclarationLanguageBase
- java.lang.Object
-
- javax.faces.view.ViewDeclarationLanguage
-
- org.apache.myfaces.view.ViewDeclarationLanguageBase
-
- org.apache.myfaces.view.jsp.JspViewDeclarationLanguageBase
-
- Direct Known Subclasses:
JspViewDeclarationLanguage
public abstract class JspViewDeclarationLanguageBase extends ViewDeclarationLanguageBase
-
-
Field Summary
-
Fields inherited from class javax.faces.view.ViewDeclarationLanguage
FACELETS_VIEW_DECLARATION_LANGUAGE_ID, JSP_VIEW_DECLARATION_LANGUAGE_ID
-
-
Constructor Summary
Constructors Constructor Description JspViewDeclarationLanguageBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanactuallyRenderView(FacesContext facesContext, UIViewRoot viewToRender)Render the view now - properly setting and resetting the response writer [MF] Modified to return a boolean so subclass that delegates can determine whether the rendering succeeded or not.voidbuildView(FacesContext context, UIViewRoot view)protected StringcalculateViewId(FacesContext context, String viewId)Calculates the effective view identifier for the specified raw view identifier.protected voidflushBufferToWriter(StringBuffer buff, Writer writer)BeanInfogetComponentMetadata(FacesContext context, Resource componentResource)StringgetId()ResourcegetScriptComponentResource(FacesContext context, Resource componentResource)StateManagementStrategygetStateManagementStrategy(FacesContext context, String viewId)ViewMetadatagetViewMetadata(FacesContext context, String viewId)protected booleanisViewBuilt(FacesContext facesContext, UIViewRoot view)Returns true if the given UIViewRoot has already been built via VDL.buildView().protected booleanisViewStateAlreadyEncoded(FacesContext context)voidrenderView(FacesContext context, UIViewRoot view)protected voidsetAfterViewTagResponseWrapper(ExternalContext ec, ViewResponseWrapper wrapper)protected voidsetViewBuilt(FacesContext facesContext, UIViewRoot view)Saves a flag in the attribute map of the FacesContext to indicate that the given UIViewRoot was already built with VDL.buildView().protected voidwritePartialBuffer(StringBuffer contentBuffer, int beginIndex, int endIndex, Writer writer)-
Methods inherited from class org.apache.myfaces.view.ViewDeclarationLanguageBase
createView, restoreView, sendSourceNotFound
-
Methods inherited from class javax.faces.view.ViewDeclarationLanguage
calculateResourceLibraryContracts, createComponent, getViews, getViews, retargetAttachedObjects, retargetMethodExpressions, viewExists
-
-
-
-
Method Detail
-
getId
public String getId()
- Overrides:
getIdin classViewDeclarationLanguage
-
buildView
public void buildView(FacesContext context, UIViewRoot view) throws IOException
- Specified by:
buildViewin classViewDeclarationLanguage- Throws:
IOException
-
getComponentMetadata
public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource)
- Specified by:
getComponentMetadatain classViewDeclarationLanguage
-
getScriptComponentResource
public Resource getScriptComponentResource(FacesContext context, Resource componentResource)
- Specified by:
getScriptComponentResourcein classViewDeclarationLanguage
-
renderView
public void renderView(FacesContext context, UIViewRoot view) throws IOException
- Specified by:
renderViewin classViewDeclarationLanguage- Throws:
IOException
-
getViewMetadata
public ViewMetadata getViewMetadata(FacesContext context, String viewId)
- Specified by:
getViewMetadatain classViewDeclarationLanguage
-
isViewStateAlreadyEncoded
protected boolean isViewStateAlreadyEncoded(FacesContext context)
-
setAfterViewTagResponseWrapper
protected void setAfterViewTagResponseWrapper(ExternalContext ec, ViewResponseWrapper wrapper)
-
flushBufferToWriter
protected void flushBufferToWriter(StringBuffer buff, Writer writer) throws IOException
- Throws:
IOException
-
writePartialBuffer
protected void writePartialBuffer(StringBuffer contentBuffer, int beginIndex, int endIndex, Writer writer) throws IOException
- Throws:
IOException
-
actuallyRenderView
protected boolean actuallyRenderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException
Render the view now - properly setting and resetting the response writer [MF] Modified to return a boolean so subclass that delegates can determine whether the rendering succeeded or not. TRUE means success.- Throws:
IOException
-
getStateManagementStrategy
public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId)
- Specified by:
getStateManagementStrategyin classViewDeclarationLanguage
-
calculateViewId
protected String calculateViewId(FacesContext context, String viewId)
Description copied from class:ViewDeclarationLanguageBaseCalculates the effective view identifier for the specified raw view identifier.- Specified by:
calculateViewIdin classViewDeclarationLanguageBase- Parameters:
context- le current FacesContextviewId- the raw view identifier- Returns:
- the effective view identifier
-
isViewBuilt
protected boolean isViewBuilt(FacesContext facesContext, UIViewRoot view)
Returns true if the given UIViewRoot has already been built via VDL.buildView(). This is necessary because legacy ViewHandler implementations return null on getViewDeclarationLanguage() and thus VDL.buildView() is never called. So we have to check this in renderView() and, if it is false, we have to call buildView() manually before the rendering.- Parameters:
facesContext-view-- Returns:
-
setViewBuilt
protected void setViewBuilt(FacesContext facesContext, UIViewRoot view)
Saves a flag in the attribute map of the FacesContext to indicate that the given UIViewRoot was already built with VDL.buildView().- Parameters:
facesContext-view-
-
-