public class StrutsBodyTagSupport
extends javax.servlet.jsp.tagext.BodyTagSupport
Constructor and Description |
---|
StrutsBodyTagSupport() |
Modifier and Type | Method and 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() |
protected String |
findString(String expr) |
protected Object |
findValue(String expr) |
protected Object |
findValue(String expr,
Class<?> toType) |
protected String |
getBody() |
protected boolean |
getPerformClearTagStateForTagPoolingServers()
Allow descendant tags to check if the tag state should be cleared during
doEndTag() processing, |
protected ValueStack |
getStack() |
void |
release()
Release state for a Struts JSP Tag handler.
|
void |
setPerformClearTagStateForTagPoolingServers(boolean performClearTagStateForTagPoolingServers)
Request that the tag state be cleared during
doEndTag() processing,
which may help with certain edge cases with tag logic running on servers that implement JSP Tag Pooling. |
protected String |
toString(Throwable t) |
doAfterBody, doInitBody, doStartTag, getBodyContent, getPreviousOut, setBodyContent
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
protected ValueStack getStack()
protected String getBody()
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public void release()
According to the JSP API documentation, the page compiler guarantees that the release() method will be invoked on the Tag handler before releasing it to the GC (garbage collector). It does not specify when the release() call will be made, though, and timing likely depends on the implementation of the JSP/servlet engine being used.
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
public void setPerformClearTagStateForTagPoolingServers(boolean performClearTagStateForTagPoolingServers)
doEndTag()
processing,
which may help with certain edge cases with tag logic running on servers that implement JSP Tag Pooling.
Note: Even though the Tag classes extend this class StrutsBodyTagSupport
, and this method
setPerformClearTagStateForTagPoolingServers(boolean)
exists in the method hierarchy,
the JSP processing requires us to explicitly override it in every Tag class in order for the Tag handler
method to be visible to the JSP processing.
Defining a setter in the superclass alone is insufficient (results in "Cannot find a setter method for the attribute").
See clearTagStateForTagPoolingServers()
for additional details.
Warning: Setting this value to true may allow for the desired behaviour, but doing so
may violate the JSP specification. Set to true at your own risk.
performClearTagStateForTagPoolingServers
- true if tag state should be cleared, false otherwise.protected boolean getPerformClearTagStateForTagPoolingServers()
doEndTag()
processing,protected void clearTagStateForTagPoolingServers()
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 ComponentTagSupport.clearTagStateForTagPoolingServers()
method first, then resetting instance variables at the current level to their default state.
Note: If the descendant overrides 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.
Copyright © 2000–2024 Apache Software Foundation. All rights reserved.