Package org.apache.struts2.views.jsp

# Class ComponentTagSupport

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
jakarta.servlet.jsp.tagext.BodyTagSupport
org.apache.struts2.views.jsp.StrutsBodyTagSupport
org.apache.struts2.views.jsp.ComponentTagSupport

All Implemented Interfaces:
  `jakarta.servlet.jsp.tagext.BodyTag`, `jakarta.servlet.jsp.tagext.IterationTag`, `jakarta.servlet.jsp.tagext.JspTag`, `jakarta.servlet.jsp.tagext.Tag`, `Serializable`

Direct Known Subclasses:
  `AbstractUITag`, `ContextBeanTag`, `ElseIfTag`, `ElseTag`, `I18nTag`, `IfTag`, `IncludeTag`, `OptGroupTag`, `ParamTag`, `PropertyTag`, `PushTag`

public abstract class ComponentTagSupport extends StrutsBodyTagSupport

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Component`
  `component`

  ### Fields inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport

  `bodyContent`

  ### Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

  `id, pageContext`

  ### Fields inherited from interface jakarta.servlet.jsp.tagext.BodyTag

  `EVAL_BODY_BUFFERED, EVAL_BODY_TAG`

  ### Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

  `EVAL_BODY_AGAIN`

  ### Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

  `EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ComponentTagSupport()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `clearTagStateForTagPoolingServers()`
  Provide a mechanism to clear tag state, to handle servlet container JSP tag pooling behaviour with some servers, such as Glassfish.
  `int`
  `doEndTag()`
  `int`
  `doStartTag()`
  `abstract Component`
  `getBean(ValueStack stack, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)`
  `Component`
  `getComponent()`
  `protected void`
  `populateParams()`
  Define method to populate component state based on the Tag attributes.
  `protected void`
  `populatePerformClearTagStateForTagPoolingServersParam()`
  Specialized method to populate the performClearTagStateForTagPoolingServers state of the Component to match the value set in the Tag.

  ### Methods inherited from class org.apache.struts2.views.jsp.StrutsBodyTagSupport

  `findString, findValue, findValue, getBody, getPerformClearTagStateForTagPoolingServers, getStack, release, setPerformClearTagStateForTagPoolingServers, toString`

  ### Methods inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport

  `doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent`

  ### Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

  `findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface jakarta.servlet.jsp.tagext.Tag

  `getParent, setPageContext, setParent`

- ## Field Details

  - ### component

    protected Component component

- ## Constructor Details

  - ### ComponentTagSupport

    public ComponentTagSupport()

- ## Method Details

  - ### getBean

    public abstract Component getBean(ValueStack stack, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)

  - ### doEndTag

    public int doEndTag() throws jakarta.servlet.jsp.JspException
    Specified by:
      `doEndTag` in interface `jakarta.servlet.jsp.tagext.Tag`
    Overrides:
      `doEndTag` in class `StrutsBodyTagSupport`
    Throws:
      `jakarta.servlet.jsp.JspException`

  - ### doStartTag

    public int doStartTag() throws jakarta.servlet.jsp.JspException
    Specified by:
      `doStartTag` in interface `jakarta.servlet.jsp.tagext.Tag`
    Overrides:
      `doStartTag` in class `jakarta.servlet.jsp.tagext.BodyTagSupport`
    Throws:
      `jakarta.servlet.jsp.JspException`

  - ### populateParams

    protected void populateParams()
    Define method to populate component state based on the Tag attributes. Descendants should override this method for custom behaviour, but should always call the ancestor method when doing so.

  - ### populatePerformClearTagStateForTagPoolingServersParam

    protected void populatePerformClearTagStateForTagPoolingServersParam()
    Specialized method to populate the performClearTagStateForTagPoolingServers state of the Component to match the value set in the Tag.

    Generally only unit tests would call this method directly, to avoid calling the whole populateParams() chain again after doStartTag() has been called. Doing that can break tag / component state behaviour, but unit tests still need a way to set the performClearTagStateForTagPoolingServers state for the component (which only comes into being after doStartTag() is called).

  - ### getComponent

    public Component getComponent()

  - ### clearTagStateForTagPoolingServers

    protected void clearTagStateForTagPoolingServers()
    Description copied from class: `StrutsBodyTagSupport`
    Provide a mechanism to clear tag state, to handle servlet container JSP tag pooling behaviour with some servers, such as Glassfish.

    Usage: Override this method in descendant classes to clear any state that might cause issues should the servlet container re-use a cached instance of the tag object. If the descendant class does not declare any new field members then it should not be strictly necessary to call this method there. Typically that means calling the ancestor's `clearTagStateForTagPoolingServers()` method first, then resetting instance variables at the current level to their default state.

    Note: If the descendant overrides `StrutsBodyTagSupport.doEndTag()`, and does not call super.doEndTag(), then the descendant should call this method in the descendant doEndTag() method to ensure consistent clearing of tag state.

    Overrides:
      `clearTagStateForTagPoolingServers` in class `StrutsBodyTagSupport`