Save This Page
Home » spring-framework-2.5.6-with-dependencies » org.springframework » web » util » [javadoc | source]
org.springframework.web.util
abstract public class: ExpressionEvaluationUtils [javadoc | source]
java.lang.Object
   org.springframework.web.util.ExpressionEvaluationUtils
Convenience methods for transparent access to JSP 2.0's built-in javax.servlet.jsp.el.ExpressionEvaluator or the standalone org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager of Jakarta's JSTL implementation.

Automatically detects JSP 2.0 or Jakarta JSTL, preferring the JSP 2.0 mechanism if available. Also detects the JSP 2.0 API being present but the runtime JSP engine not actually supporting JSP 2.0, falling back to the Jakarta JSTL in this case. Throws an exception when encountering actual EL expressions if neither JSP 2.0 nor the Jakarta JSTL is available.

In the case of JSP 2.0, this class will by default use standard evaluate calls. If your application server happens to be inefficient in that respect, consider setting Spring's "cacheJspExpressions" context-param in web.xml to "true", which will use parseExpression calls with cached Expression objects instead.

The evaluation methods check if the value contains "${" before invoking the EL evaluator, treating the value as "normal" expression (i.e. a literal String value) else.

Note: The evaluation methods do not have a runtime dependency on JSP 2.0 or on Jakarta's JSTL implementation, as long as they are not asked to process actual EL expressions. This allows for using EL-aware tags with Java-based JSP expressions instead, for example.

Field Summary
public static final  String EXPRESSION_CACHE_CONTEXT_PARAM    JSP 2.0 expression cache parameter at the servlet context level (i.e. a context-param in web.xml): "cacheJspExpressions". 
public static final  String EXPRESSION_PREFIX     
public static final  String EXPRESSION_SUFFIX     
Method from org.springframework.web.util.ExpressionEvaluationUtils Summary:
evaluate,   evaluate,   evaluateBoolean,   evaluateInteger,   evaluateString,   isExpressionLanguage
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.web.util.ExpressionEvaluationUtils Detail:
 public static Object evaluate(String attrName,
    String attrValue,
    PageContext pageContext) throws JspException 
    Evaluate the given expression (be it EL or a literal String value) to an Object.
 public static Object evaluate(String attrName,
    String attrValue,
    Class resultClass,
    PageContext pageContext) throws JspException 
    Evaluate the given expression (be it EL or a literal String value) to an Object of a given type,
 public static boolean evaluateBoolean(String attrName,
    String attrValue,
    PageContext pageContext) throws JspException 
    Evaluate the given expression (be it EL or a literal String value) to a boolean.
 public static int evaluateInteger(String attrName,
    String attrValue,
    PageContext pageContext) throws JspException 
    Evaluate the given expression (be it EL or a literal String value) to an integer.
 public static String evaluateString(String attrName,
    String attrValue,
    PageContext pageContext) throws JspException 
    Evaluate the given expression (be it EL or a literal String value) to a String.
 public static boolean isExpressionLanguage(String value) 
    Check if the given expression value is an EL expression.