Class ViewTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.BodyTag,jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspIdConsumer,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag
public class ViewTag extends UIComponentELTag
-
Field Summary
Fields Modifier and Type Field Description protected jakarta.el.MethodExpressionafterPhaseprotected jakarta.el.MethodExpressionbeforePhaseprotected jakarta.el.ValueExpressionlocaleprotected jakarta.el.ValueExpressionrenderKitIdFields inherited from class jakarta.faces.webapp.UIComponentClassicTagBase
bodyContent, pageContext, UNIQUE_ID_PREFIX -
Constructor Summary
Constructors Constructor Description ViewTag() -
Method Summary
Modifier and Type Method Description intdoAfterBody()Examine the body content of this tag.intdoEndTag()Exercise a contract with theViewHandlerto get the character encoding from the response and set it into the session.intdoStartTag()Override parentdoStartTag()to do the following:StringgetComponentType()Return the component type for the component that is or will be bound to this tag.protected intgetDoEndValue()Return the flag value that should be returned from thedoEnd()method when it is called.protected intgetDoStartValue()Return the flag value that should be returned from thedoStart()method when it is called.protected LocalegetLocaleFromString(String localeExpr)Returns the locale represented by the expression.StringgetRendererType()Return therendererTypeproperty that selects theRendererto be used for encoding this component, ornullto ask the component to render itself directly.voidsetAfterPhase(jakarta.el.MethodExpression newAfterPhase)voidsetBeforePhase(jakarta.el.MethodExpression newBeforePhase)voidsetLocale(jakarta.el.ValueExpression newLocale)protected voidsetProperties(UIComponent component)Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.voidsetRenderKitId(jakarta.el.ValueExpression renderKitId)Methods inherited from class jakarta.faces.webapp.UIComponentELTag
createComponent, getELContext, hasBinding, release, setBinding, setRenderedMethods inherited from class jakarta.faces.webapp.UIComponentClassicTagBase
addChild, addFacet, addVerbatimAfterComponent, addVerbatimBeforeComponent, createVerbatimComponent, createVerbatimComponentFromBodyContent, doInitBody, encodeBegin, encodeChildren, encodeEnd, findComponent, getBodyContent, getComponentInstance, getCreated, getCreatedComponents, getDoAfterBodyValue, getFacesContext, getFacesJspId, getFacetName, getId, getIndexOfNextChildTag, getJspId, getParent, getParentUIComponentClassicTagBase, getPreviousOut, setBodyContent, setId, setJspId, setPageContext, setParent, setupResponseWriter
-
Field Details
-
renderKitId
protected jakarta.el.ValueExpression renderKitId -
locale
protected jakarta.el.ValueExpression locale -
beforePhase
protected jakarta.el.MethodExpression beforePhase -
afterPhase
protected jakarta.el.MethodExpression afterPhase
-
-
Constructor Details
-
ViewTag
public ViewTag()
-
-
Method Details
-
setRenderKitId
public void setRenderKitId(jakarta.el.ValueExpression renderKitId) -
setLocale
public void setLocale(jakarta.el.ValueExpression newLocale) -
setBeforePhase
public void setBeforePhase(jakarta.el.MethodExpression newBeforePhase) -
setAfterPhase
public void setAfterPhase(jakarta.el.MethodExpression newAfterPhase) -
getDoStartValue
protected int getDoStartValue() throws jakarta.servlet.jsp.JspExceptionDescription copied from class:UIComponentClassicTagBaseReturn the flag value that should be returned from the
doStart()method when it is called. Subclasses may override this method to return the appropriate value.- Overrides:
getDoStartValuein classUIComponentClassicTagBase- Returns:
- the value to return from
doStart() - Throws:
jakarta.servlet.jsp.JspException- to causedoStart()to throw an exception
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionOverride parent
doStartTag()to do the following:-
Reflect the response object for a method called flushContentToWrappedResponse and invoke it. This causes any content that appears before the view to be written out to the response. This is necessary to allow proper ordering to happen.
- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classUIComponentClassicTagBase- Throws:
jakarta.servlet.jsp.JspException- if an error occurs
-
-
doAfterBody
public int doAfterBody() throws jakarta.servlet.jsp.JspExceptionExamine the body content of this tag. If it is non-
null, non-zero length, and not an HTML comment, callUIComponentClassicTagBase.createVerbatimComponent().Set the value of the verbatim component to be
content.Add this child to the end of the child list for
UIViewRoot.- Specified by:
doAfterBodyin interfacejakarta.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classUIComponentClassicTagBase- Throws:
jakarta.servlet.jsp.JspException- if an error is encountered
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspExceptionExercise a contract with the
ViewHandlerto get the character encoding from the response and set it into the session.- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classUIComponentClassicTagBase- Throws:
jakarta.servlet.jsp.JspException- if an error occurs
-
getComponentType
Description copied from class:UIComponentTagBaseReturn the component type for the component that is or will be bound to this tag. This value can be passed to
Application.createComponent(java.lang.String)to create theUIComponentinstance for this tag. Subclasses must override this method to return the appropriate value.- Specified by:
getComponentTypein classUIComponentTagBase- Returns:
- the component type
-
getRendererType
Description copied from class:UIComponentTagBaseReturn the
rendererTypeproperty that selects theRendererto be used for encoding this component, ornullto ask the component to render itself directly. Subclasses must override this method to return the appropriate value.- Specified by:
getRendererTypein classUIComponentTagBase- Returns:
- the renderer type
-
getDoEndValue
protected int getDoEndValue() throws jakarta.servlet.jsp.JspExceptionDescription copied from class:UIComponentClassicTagBaseReturn the flag value that should be returned from the
doEnd()method when it is called. Subclasses may override this method to return the appropriate value.- Overrides:
getDoEndValuein classUIComponentClassicTagBase- Returns:
- the value to return from
doEnd() - Throws:
jakarta.servlet.jsp.JspException- to causedoEnd()to throw an exception
-
setProperties
Description copied from class:UIComponentELTagOverride properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified
UIComponentwas in fact created during the execution of this tag handler instance, and this call will occur BEFORE theUIComponentis added to the view.Tag subclasses that want to support additional set properties must ensure that the base class
setProperties()method is still called. A typical implementation that supports extra propertiesfooandbarwould look something like this:protected void setProperties(UIComponent component) { super.setProperties(component); if (foo != null) { component.setAttribute("foo", foo); } if (bar != null) { component.setAttribute("bar", bar); } }The default implementation overrides the following properties:
rendered- Set if a value for therenderedproperty is specified for this tag handler instance.rendererType- Set if thegetRendererType()method returns a non-null value.
- Overrides:
setPropertiesin classUIComponentELTag- Parameters:
component-UIComponentwhose properties are to be overridden
-
getLocaleFromString
Returns the locale represented by the expression.- Parameters:
localeExpr- a String in the format specified by JSTL Specification as follows: "A String value is interpreted as the printable representation of a locale, which must contain a two-letter (lower-case) language code (as defined by ISO-639), and may contain a two-letter (upper-case) country code (as defined by ISO-3166). Language and country codes must be separated by hyphen (???-???) or underscore (???_???)."- Returns:
- Locale instance cosntructed from the expression.
-