Context information for expression evaluation. To evaluate an {@link Expression}, an ELContext must be provided. The ELContext holds:
- a reference to the base {@link ELResolver} that will be consulted to resolve model objectsand their properties
- a reference to {@link FunctionMapper} that will be used to resolve EL Functions.
- a reference to {@link VariableMapper} that will be used to resolve EL Variables.
- a collection of all the relevant context objects for use by ELResolvers
- state information during the evaluation of an expression, such as whether a property has been resolved yet
The collection of context objects is necessary because each ELResolver may need access to a different context object. For example, JSP and Faces resolvers need access to a javax.servlet.jsp.JspContext and a javax.faces.context.FacesContext, respectively. Creation of ELContext objects is controlled through the underlying technology. For example, in JSP the JspContext.getELContext() factory method is used. Some technologies provide the ability to add an {@link ELContextListener} so that applications and frameworks can ensure their own contextobjects are attached to any newly created ELContext. Because it stores state during expression evaluation, an ELContext object is not thread-safe. Care should be taken to never share an ELContext instance between two or more threads.