| Modifier and Type | Field and Description | 
|---|---|
| protected ActionMapper | actionMapper | 
| static String | COMPONENT_STACK | 
| protected boolean | devMode | 
| protected boolean | escapeHtmlBody | 
| protected Map<String,Object> | parametersDeprecated. 
 use  getAttributes()instead of directly depending on this field | 
| protected boolean | performClearTagStateForTagPoolingServers | 
| protected ValueStack | stack | 
| protected static ConcurrentMap<Class<?>,Collection<String>> | standardAttributesMapCaches information about common tag's attributes to reduce scanning for annotation @StrutsTagAttribute | 
| protected boolean | throwExceptionOnELFailure | 
| Constructor and Description | 
|---|
| Component(ValueStack stack)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addAllParameters(Map<String,Object> params)Adds all the given parameters to this component's own parameters. | 
| void | addParameter(String key,
            Object value)Adds the given key and value to this component's own parameter. | 
| protected String | completeExpression(String expr)Adds the surrounding %{ } to the expression for proper processing. | 
| void | copyParams(Map<String,Object> params)Pushes this component's parameter Map as well as the component itself on to the stack
 and then copies the supplied parameters over. | 
| protected String | determineActionURL(String action,
                  String namespace,
                  String method,
                  javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res,
                  Map<String,Object> parameters,
                  String scheme,
                  boolean includeContext,
                  boolean encodeResult,
                  boolean forceAddSchemeHostAndPort,
                  boolean escapeAmp)Renders an action URL by consulting the  ActionMapper. | 
| protected String | determineNamespace(String namespace,
                  ValueStack stack,
                  javax.servlet.http.HttpServletRequest req)Determines the namespace of the current page being renderdd. | 
| boolean | end(Writer writer,
   String body)Callback for the end tag of this component. | 
| protected boolean | end(Writer writer,
   String body,
   boolean popComponentStack)Callback for the start tag of this component. | 
| boolean | escapeHtmlBody()Override to set if body content should be HTML-escaped. | 
| protected StrutsException | fieldError(String field,
          String errorMsg,
          Exception e)Constructs a  RuntimeExceptionbased on the given information. | 
| protected Component | findAncestor(Class<?> clazz)Finds the nearest ancestor of this component stack. | 
| protected String | findString(String expr)Evaluates the OGNL stack to find a String value. | 
| protected String | findString(String expr,
          String field,
          String errorMsg)Evaluates the OGNL stack to find a String value. | 
| protected Object | findValue(String expression)Finds a value from the OGNL stack based on the given expression. | 
| protected Object | findValue(String expression,
         Class<?> toType)Evaluates the OGNL stack to find an Object of the given type. | 
| protected Object | findValue(String expr,
         String field,
         String errorMsg)
 Evaluates the OGNL stack to find an Object value. | 
| Map<String,Object> | getAttributes()Gets the parameters. | 
| Stack<Component> | getComponentStack()Gets the component stack of this component. | 
| protected String | getNamespace(ValueStack stack) | 
| Map<String,Object> | getParameters()Deprecated. 
 since 6.7.0, use  getAttributes()instead | 
| boolean | getPerformClearTagStateForTagPoolingServers() | 
| ValueStack | getStack()Gets the OGNL value stack associated with this component. | 
| protected Collection<String> | getStandardAttributes()If needed caches all methods annotated by given annotation to avoid further scans | 
| protected boolean | isAcceptableExpression(String expression)Checks if expression doesn't contain vulnerable code | 
| boolean | isValidTagAttribute(String attrName)Checks if provided name is a valid tag's attribute | 
| protected void | popComponentStack()Pops the component stack. | 
| void | setActionMapper(ActionMapper mapper) | 
| void | setDevMode(String devMode) | 
| void | setEscapeHtmlBody(String escapeHtmlBody) | 
| void | setNotExcludedAcceptedPatterns(NotExcludedAcceptedPatternsChecker notExcludedAcceptedPatterns) | 
| void | setPerformClearTagStateForTagPoolingServers(boolean performClearTagStateForTagPoolingServers)Request that the tag state be cleared during  StrutsBodyTagSupport.doEndTag()processing,
 which may help with certain edge cases with tag logic running on servers that implement JSP Tag Pooling. | 
| void | setThrowExceptionsOnELFailure(String throwException) | 
| void | setUrlHelper(UrlHelper urlHelper) | 
| boolean | start(Writer writer)Callback for the start tag of this component. | 
| protected String | stripExpression(String expression)If %{...} is applied, simply strip the "%{" and "}" off. | 
| protected String | toString(Throwable t)Constructs a string representation of the given exception. | 
| boolean | usesBody()Overwrite to set if body should be used. | 
public static final String COMPONENT_STACK
protected static ConcurrentMap<Class<?>,Collection<String>> standardAttributesMap
protected boolean devMode
protected boolean escapeHtmlBody
protected ValueStack stack
@Deprecated protected Map<String,Object> parameters
getAttributes() instead of directly depending on this fieldprotected ActionMapper actionMapper
protected boolean throwExceptionOnELFailure
protected boolean performClearTagStateForTagPoolingServers
public Component(ValueStack stack)
stack - OGNL value stack.public void setDevMode(String devMode)
public void setActionMapper(ActionMapper mapper)
public void setThrowExceptionsOnELFailure(String throwException)
public void setEscapeHtmlBody(String escapeHtmlBody)
public void setUrlHelper(UrlHelper urlHelper)
public void setNotExcludedAcceptedPatterns(NotExcludedAcceptedPatternsChecker notExcludedAcceptedPatterns)
public ValueStack getStack()
public Stack<Component> getComponentStack()
public boolean start(Writer writer)
writer - the output writer.public boolean end(Writer writer, String body)
writer - the output writer.body - the rendered body.protected boolean end(Writer writer, String body, boolean popComponentStack)
writer - the output writer.body - the rendered body.popComponentStack - should the component stack be popped?protected void popComponentStack()
protected Component findAncestor(Class<?> clazz)
clazz - the class to look for, or if assignable from.protected String findString(String expr)
expr - OGNL expression.protected String findString(String expr, String field, String errorMsg)
RuntimeException is thrown
 constructed with a messaged based on the given field and errorMsg parameter.expr - OGNL expression.field - field name used when throwing RuntimeException.errorMsg - error message used when throwing RuntimeException.StrutsException - is thrown in case of expression is null.protected StrutsException fieldError(String field, String errorMsg, Exception e)
RuntimeException based on the given information.
 RuntimeException.field - field name used when throwing RuntimeException.errorMsg - error message used when throwing RuntimeException.e - the caused exception, can be null.StrutsException.protected Object findValue(String expression)
expr against stack except when expr
 is null. If %{...} is applied, simply strip it off.expression - the expression. Returns null if expr is null.protected String stripExpression(String expression)
expression - the expression (must be not null)protected String completeExpression(String expr)
expr - the expression.protected Object findValue(String expr, String field, String errorMsg)
Evaluates the OGNL stack to find an Object value.
 Function just like findValue(String) except that if the
 given expression is null a error is logged and
 a RuntimeException is thrown constructed with a
 messaged based on the given field and errorMsg parameter.
 
expr - OGNL expression.field - field name used when throwing RuntimeException.errorMsg - error message used when throwing RuntimeException.StrutsException - is thrown in case of not found in the OGNL stack, or expression is null.protected Object findValue(String expression, Class<?> toType)
expression the portion wrapped with %{...} against stack if
 evaluating to String.class, else the whole expression is evaluated
 against the stack.expression - OGNL expression.toType - the type expected to find.protected String determineActionURL(String action, String namespace, String method, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Map<String,Object> parameters, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp)
ActionMapper.action - the actionnamespace - the namespacemethod - the methodreq - HTTP requestres - HTTP responseparameters - parametersscheme - http or httpsincludeContext - should the context path be included or notencodeResult - should the url be encodedforceAddSchemeHostAndPort - should the scheme host and port be forcedescapeAmp - should ampersand (&) be escaped to &protected String determineNamespace(String namespace, ValueStack stack, javax.servlet.http.HttpServletRequest req)
namespace - the namespacestack - OGNL value stackreq - HTTP requestprotected String getNamespace(ValueStack stack)
public void copyParams(Map<String,Object> params)
params - the parameters to copy.protected String toString(Throwable t)
t - the exception@Deprecated public Map<String,Object> getParameters()
getAttributes() insteadpublic Map<String,Object> getAttributes()
public void addAllParameters(Map<String,Object> params)
params - the parameters to add.public void addParameter(String key, Object value)
key - the key of the new parameter to add.value - the value associated with the key.public boolean usesBody()
public boolean escapeHtmlBody()
public boolean isValidTagAttribute(String attrName)
attrName - String name of attributeprotected Collection<String> getStandardAttributes()
public void setPerformClearTagStateForTagPoolingServers(boolean performClearTagStateForTagPoolingServers)
StrutsBodyTagSupport.doEndTag() processing,
 which may help with certain edge cases with tag logic running on servers that implement JSP Tag Pooling.
 Note: All Tag classes that extend StrutsBodyTagSupport must implement a setter for
 this attribute (same name), and it must be defined at the Tag class level.
 Defining a setter in the superclass alone is insufficient (results in "Cannot find a setter method for the attribute").
 See {@link org.apache.struts2.views.jsp.StrutsBodyTagSupport#clearTagStateForTagPoolingServers() for additional details.
performClearTagStateForTagPoolingServers - true if tag state should be cleared, false otherwise.public boolean getPerformClearTagStateForTagPoolingServers()
protected boolean isAcceptableExpression(String expression)
expression - of the componentCopyright © 2000–2025 Apache Software Foundation. All rights reserved.