JspApplicationContextImpl (Apache Tomcat 10.1.57 API Documentation)
Description: declaration: package: org.apache.jasper.runtime, class: JspApplicationContextImpl

# Class JspApplicationContextImpl

java.lang.Object
org.apache.jasper.runtime.JspApplicationContextImpl

All Implemented Interfaces:
  `JspApplicationContext`

public class JspApplicationContextImpl extends Object implements JspApplicationContext
Implementation of JspApplicationContext.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JspApplicationContextImpl()`
  Constructs a new JspApplicationContextImpl instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addELContextListener(ELContextListener listener)`
  Registers an `ELContextListener` that will be notified whenever a new `ELContext` is created.
  `void`
  `addELResolver(ELResolver resolver)`
  Adds an `ELResolver` to the chain of EL variable and property management within JSP pages and Tag files.
  `ELContextImpl`
  `createELContext(JspContext context)`
  Creates an ELContext for the given JspContext.
  `protected void`
  `fireListeners(ELContext elContext)`
  Notifies all registered ELContextListeners that a new ELContext has been created.
  `ExpressionFactory`
  `getExpressionFactory()`
  Returns the JSP container's `ExpressionFactory` implementation for EL use.
  `static JspApplicationContextImpl`
  `getInstance(ServletContext context)`
  Returns the JspApplicationContextImpl singleton for the given ServletContext.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JspApplicationContextImpl

    public JspApplicationContextImpl()
    Constructs a new JspApplicationContextImpl instance.

- ## Method Details

  - ### addELContextListener

    public void addELContextListener(ELContextListener listener)
    Description copied from interface: `jakarta.servlet.jsp.JspApplicationContext`
    Registers an `ELContextListener` that will be notified whenever a new `ELContext` is created.

    At the very least, any `ELContext` instantiated will have reference to the `JspContext` under `JspContext.class`.

    Specified by:
      `addELContextListener` in interface `JspApplicationContext`
    Parameters:
      `listener` - The listener to add

  - ### getInstance

    public static JspApplicationContextImpl getInstance(ServletContext context)
    Returns the JspApplicationContextImpl singleton for the given ServletContext. Creates a new instance if one does not yet exist.
    Parameters:
      `context` - The ServletContext
    Returns:
      The JspApplicationContextImpl instance

  - ### createELContext

    public ELContextImpl createELContext(JspContext context)
    Creates an ELContext for the given JspContext.
    Parameters:
      `context` - The JspContext
    Returns:
      The created ELContextImpl

  - ### fireListeners

    protected void fireListeners(ELContext elContext)
    Notifies all registered ELContextListeners that a new ELContext has been created.
    Parameters:
      `elContext` - The newly created ELContext

  - ### addELResolver

    public void addELResolver(ELResolver resolver) throws IllegalStateException
    Description copied from interface: `jakarta.servlet.jsp.JspApplicationContext`

    Adds an `ELResolver` to the chain of EL variable and property management within JSP pages and Tag files.

    JSP has a default set of ELResolvers to chain for all EL evaluation:

    - `ImplicitObjectELResolver`
    - `ELResolver` instances registered with this method
    - `MapELResolver`
    - `ListELResolver`
    - `ArrayELResolver`
    - `BeanELResolver`
    - `ScopedAttributeELResolver`
    Specified by:
      `addELResolver` in interface `JspApplicationContext`
    Parameters:
      `resolver` - an additional resolver
    Throws:
      `IllegalStateException` - if called after the application's `ServletContextListeners` have been initialized.

  - ### getExpressionFactory

    public ExpressionFactory getExpressionFactory()
    Description copied from interface: `jakarta.servlet.jsp.JspApplicationContext`

    Returns the JSP container's `ExpressionFactory` implementation for EL use.

    Specified by:
      `getExpressionFactory` in interface `JspApplicationContext`
    Returns:
      an `ExpressionFactory` implementation