org.springframework.web.util
@Deprecated public abstract class ExpressionEvaluationUtils extends Object
ExpressionEvaluator
.
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.
See isSpringJspExpressionSupportActive(javax.servlet.jsp.PageContext)
for guidelines
on when to use Spring's JSP expression support as opposed to the
built-in expression support in JSP 2.0+ containers.
ExpressionEvaluator.evaluate(java.lang.String, java.lang.Class, javax.servlet.jsp.el.VariableResolver, javax.servlet.jsp.el.FunctionMapper)
Modifier and Type | Field and Description |
---|---|
static String |
EXPRESSION_PREFIX
Deprecated.
|
static String |
EXPRESSION_SUFFIX
Deprecated.
|
static String |
EXPRESSION_SUPPORT_CONTEXT_PARAM
Deprecated.
Expression support parameter at the servlet context level
(i.e.
|
Constructor and Description |
---|
ExpressionEvaluationUtils()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Object |
evaluate(String attrName,
String attrValue,
Class resultClass,
javax.servlet.jsp.PageContext pageContext)
Deprecated.
Evaluate the given expression (be it EL or a literal String value)
to an Object of a given type,
|
static Object |
evaluate(String attrName,
String attrValue,
javax.servlet.jsp.PageContext pageContext)
Deprecated.
Evaluate the given expression (be it EL or a literal String value) to an Object.
|
static boolean |
evaluateBoolean(String attrName,
String attrValue,
javax.servlet.jsp.PageContext pageContext)
Deprecated.
Evaluate the given expression (be it EL or a literal String value) to a boolean.
|
static int |
evaluateInteger(String attrName,
String attrValue,
javax.servlet.jsp.PageContext pageContext)
Deprecated.
Evaluate the given expression (be it EL or a literal String value) to an integer.
|
static String |
evaluateString(String attrName,
String attrValue,
javax.servlet.jsp.PageContext pageContext)
Deprecated.
Evaluate the given expression (be it EL or a literal String value) to a String.
|
static boolean |
isExpressionLanguage(String value)
Deprecated.
Check if the given expression value is an EL expression.
|
static boolean |
isSpringJspExpressionSupportActive(javax.servlet.jsp.PageContext pageContext)
Deprecated.
Check whether Spring's JSP expression support is actually active.
|
public static final String EXPRESSION_SUPPORT_CONTEXT_PARAM
web.xml
): "springJspExpressionSupport".public static final String EXPRESSION_PREFIX
public static final String EXPRESSION_SUFFIX
public static boolean isSpringJspExpressionSupportActive(javax.servlet.jsp.PageContext pageContext)
Note that JSP 2.0+ containers come with expression support themselves:
However, it will only be active for web applications declaring Servlet 2.4
or higher in their web.xml
deployment descriptor.
If a web.xml
context-param named "springJspExpressionSupport" is
found, its boolean value will be taken to decide whether this support is active.
If not found, the default is for expression support to be inactive on Servlet 3.0
containers with web applications declaring Servlet 2.4 or higher in their
web.xml
. For backwards compatibility, Spring's expression support
will remain active for applications declaring Servlet 2.3 or earlier. However,
on Servlet 2.4/2.5 containers, we can't find out what the application has declared;
as of Spring 3.2, we won't activate Spring's expression support at all then since
it got deprecated and will be removed in the next iteration of the framework.
pageContext
- current JSP PageContexttrue
if active (ExpressionEvaluationUtils will actually evaluate expressions);
false
if not active (ExpressionEvaluationUtils will return given values as-is,
relying on the JSP container pre-evaluating values before passing them to JSP tag attributes)public static boolean isExpressionLanguage(String value)
value
- the expression to checktrue
if the expression is an EL expression,
false
otherwisepublic static Object evaluate(String attrName, String attrValue, Class resultClass, javax.servlet.jsp.PageContext pageContext) throws javax.servlet.jsp.JspException
attrName
- name of the attribute (typically a JSP tag attribute)attrValue
- value of the attributeresultClass
- class that the result should have (String, Integer, Boolean)pageContext
- current JSP PageContextjavax.servlet.jsp.JspException
- in case of parsing errors, also in case of type mismatch
if the passed-in literal value is not an EL expression and not assignable to
the result classpublic static Object evaluate(String attrName, String attrValue, javax.servlet.jsp.PageContext pageContext) throws javax.servlet.jsp.JspException
attrName
- name of the attribute (typically a JSP tag attribute)attrValue
- value of the attributepageContext
- current JSP PageContextjavax.servlet.jsp.JspException
- in case of parsing errorspublic static String evaluateString(String attrName, String attrValue, javax.servlet.jsp.PageContext pageContext) throws javax.servlet.jsp.JspException
attrName
- name of the attribute (typically a JSP tag attribute)attrValue
- value of the attributepageContext
- current JSP PageContextjavax.servlet.jsp.JspException
- in case of parsing errorspublic static int evaluateInteger(String attrName, String attrValue, javax.servlet.jsp.PageContext pageContext) throws javax.servlet.jsp.JspException
attrName
- name of the attribute (typically a JSP tag attribute)attrValue
- value of the attributepageContext
- current JSP PageContextjavax.servlet.jsp.JspException
- in case of parsing errorspublic static boolean evaluateBoolean(String attrName, String attrValue, javax.servlet.jsp.PageContext pageContext) throws javax.servlet.jsp.JspException
attrName
- name of the attribute (typically a JSP tag attribute)attrValue
- value of the attributepageContext
- current JSP PageContextjavax.servlet.jsp.JspException
- in case of parsing errorsCopyright © 2015 OpenMRS Inc.. All Rights Reserved.