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 boolean
actuallyRenderView(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.void
buildView(FacesContext context, UIViewRoot view)
protected String
calculateViewId(FacesContext context, String viewId)
Calculates the effective view identifier for the specified raw view identifier.protected void
flushBufferToWriter(StringBuffer buff, Writer writer)
BeanInfo
getComponentMetadata(FacesContext context, Resource componentResource)
String
getId()
Resource
getScriptComponentResource(FacesContext context, Resource componentResource)
StateManagementStrategy
getStateManagementStrategy(FacesContext context, String viewId)
ViewMetadata
getViewMetadata(FacesContext context, String viewId)
protected boolean
isViewBuilt(FacesContext facesContext, UIViewRoot view)
Returns true if the given UIViewRoot has already been built via VDL.buildView().protected boolean
isViewStateAlreadyEncoded(FacesContext context)
void
renderView(FacesContext context, UIViewRoot view)
protected void
setAfterViewTagResponseWrapper(ExternalContext ec, ViewResponseWrapper wrapper)
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().protected void
writePartialBuffer(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:
getId
in classViewDeclarationLanguage
-
buildView
public void buildView(FacesContext context, UIViewRoot view) throws IOException
- Specified by:
buildView
in classViewDeclarationLanguage
- Throws:
IOException
-
getComponentMetadata
public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource)
- Specified by:
getComponentMetadata
in classViewDeclarationLanguage
-
getScriptComponentResource
public Resource getScriptComponentResource(FacesContext context, Resource componentResource)
- Specified by:
getScriptComponentResource
in classViewDeclarationLanguage
-
renderView
public void renderView(FacesContext context, UIViewRoot view) throws IOException
- Specified by:
renderView
in classViewDeclarationLanguage
- Throws:
IOException
-
getViewMetadata
public ViewMetadata getViewMetadata(FacesContext context, String viewId)
- Specified by:
getViewMetadata
in 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:
getStateManagementStrategy
in classViewDeclarationLanguage
-
calculateViewId
protected String calculateViewId(FacesContext context, String viewId)
Description copied from class:ViewDeclarationLanguageBase
Calculates the effective view identifier for the specified raw view identifier.- Specified by:
calculateViewId
in 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
-
-
-