Class ExpressionEvaluator


@Deprecated public abstract class ExpressionEvaluator extends Object
As of JSP 2.1, replaced by jakarta.el.ExpressionFactory

The abstract base class for an expression-language evaluator. Classes that implement an expression language expose their functionality via this abstract class.

An instance of the ExpressionEvaluator can be obtained via the JspContext / PageContext

The parseExpression() and evaluate() methods must be thread-safe. That is, multiple threads may call these methods on the same ExpressionEvaluator object simultaneously. Implementations should synchronize access if they depend on transient state. Implementations should not, however, assume that only one object of each ExpressionEvaluator type will be instantiated; global caching should therefore be static.

Only a single EL expression, starting with '${' and ending with '}', can be parsed or evaluated at a time. EL expressions cannot be mixed with static text. For example, attempting to parse or evaluate " abc${1+1}def${1+1}ghi" or even "${1+1}${1+1}" will cause an ELException to be thrown.

The following are examples of syntactically legal EL expressions:

  • ${person.lastName}
  • ${8 * 8}
  • ${my:reverse('hello')}
JSP 2.0