Package com.aspectran.web.support.tags
Class TokenTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- com.aspectran.web.support.tags.CurrentActivityAwareTag
-
- com.aspectran.web.support.tags.HtmlEscapingAwareTag
-
- com.aspectran.web.support.tags.TokenTag
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag,javax.servlet.jsp.tagext.TryCatchFinally
public class TokenTag extends HtmlEscapingAwareTag
The<token>tag evaluates a Token expression and either prints the result or assigns it to a variable.Attribute Summary Attribute Required? Runtime Expression? Description type true true The type of the token to evaluate. expression true true The expression to evaluate. htmlEscape false true Set HTML escaping for this tag, as a boolean value. Overrides the default HTML escaping setting for the current page. javaScriptEscape false true Set JavaScript escaping for this tag, as a boolean value. Default is false. scope false true The scope for the var. 'application', 'session', 'request' and 'page' scopes are supported. Defaults to page scope. This attribute has no effect unless the var attribute is also defined. var false true The name of the variable to export the evaluation result to. If not specified the evaluation result is converted to a String and written as output. Created: 2020/05/31
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringTOKEN_EVALUATOR_PAGE_ATTRIBUTEPageContextattribute for the page-levelTokenEvaluatorinstance.-
Fields inherited from class com.aspectran.web.support.tags.CurrentActivityAwareTag
logger
-
-
Constructor Summary
Constructors Constructor Description TokenTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdoEndTag()intdoStartTagInternal()Called by doStartTag to perform the actual work.voidsetExpression(java.lang.String expression)Set the expression to evaluate.voidsetJavaScriptEscape(boolean javaScriptEscape)Set JavaScript escaping for this tag, as boolean value.voidsetScope(java.lang.String scope)Set the scope to export the evaluation result to.voidsetType(java.lang.String type)Set the toke type to evaluate.voidsetVar(java.lang.String var)Set the variable name to expose the evaluation result under.-
Methods inherited from class com.aspectran.web.support.tags.HtmlEscapingAwareTag
htmlEscape, isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
-
Methods inherited from class com.aspectran.web.support.tags.CurrentActivityAwareTag
doCatch, doFinally, doStartTag, getCurrentActivity
-
-
-
-
Field Detail
-
TOKEN_EVALUATOR_PAGE_ATTRIBUTE
protected static final java.lang.String TOKEN_EVALUATOR_PAGE_ATTRIBUTE
PageContextattribute for the page-levelTokenEvaluatorinstance.- See Also:
- Constant Field Values
-
-
Method Detail
-
setType
public void setType(@Nullable java.lang.String type)
Set the toke type to evaluate.
-
setExpression
public void setExpression(@Nullable java.lang.String expression)
Set the expression to evaluate.
-
setVar
public void setVar(@Nullable java.lang.String var)
Set the variable name to expose the evaluation result under. Defaults to rendering the result to the current JspWriter.
-
setScope
public void setScope(java.lang.String scope)
Set the scope to export the evaluation result to. This attribute has no meaning unless var is also defined.
-
setJavaScriptEscape
public void setJavaScriptEscape(boolean javaScriptEscape)
Set JavaScript escaping for this tag, as boolean value. Default is "false".
-
doStartTagInternal
public int doStartTagInternal() throws javax.servlet.jsp.JspExceptionDescription copied from class:CurrentActivityAwareTagCalled by doStartTag to perform the actual work.- Specified by:
doStartTagInternalin classCurrentActivityAwareTag- Returns:
- same as TagSupport.doStartTag
- Throws:
javax.servlet.jsp.JspException- See Also:
TagSupport.doStartTag()
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspException- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.TagSupport- Throws:
javax.servlet.jsp.JspException
-
-