public class EvalTag extends HtmlEscapingAwareTag
<eval> tag evaluates a Spring expression (SpEL) and either prints
the result or assigns it to a variable. Supports the standard JSP evaluation
context consisting of implicit variables and scoped attributes.
| Attribute | Required? | Runtime Expression? | Description |
|---|---|---|---|
| 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. |
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTEid, pageContextEVAL_BODY_AGAINEVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE| Constructor and Description |
|---|
EvalTag() |
| Modifier and Type | Method and Description |
|---|---|
int |
doEndTag() |
int |
doStartTagInternal()
Called by doStartTag to perform the actual work.
|
void |
setExpression(String expression)
Set the expression to evaluate.
|
void |
setJavaScriptEscape(boolean javaScriptEscape)
Set JavaScript escaping for this tag, as boolean value.
|
void |
setScope(String scope)
Set the scope to export the evaluation result to.
|
void |
setVar(String var)
Set the variable name to expose the evaluation result under.
|
htmlEscape, isDefaultHtmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscapedoCatch, doFinally, doStartTag, getRequestContextdoAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValuepublic void setExpression(String expression)
public void setVar(String var)
public void setScope(String scope)
public void setJavaScriptEscape(boolean javaScriptEscape)
throws JspException
JspExceptionpublic int doStartTagInternal()
throws JspException
RequestContextAwareTagdoStartTagInternal in class RequestContextAwareTagJspExceptionTagSupport.doStartTag()public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class TagSupportJspException