Package org.apache.jasper.runtime
Class JspApplicationContextImpl
- java.lang.Object
-
- org.apache.jasper.runtime.JspApplicationContextImpl
-
- All Implemented Interfaces:
JspApplicationContext
public class JspApplicationContextImpl extends java.lang.Object implements JspApplicationContext
Implementation of JspApplicationContext.
-
-
Constructor Summary
Constructors Constructor Description JspApplicationContextImpl()Constructs a new JspApplicationContextImpl instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddELContextListener(ELContextListener listener)Registers anELContextListenerthat will be notified whenever a newELContextis created.voidaddELResolver(ELResolver resolver)Adds anELResolverto the chain of EL variable and property management within JSP pages and Tag files.ELContextImplcreateELContext(JspContext context)Creates an ELContext for the given JspContext.protected voidfireListeners(ELContext elContext)Notifies all registered ELContextListeners that a new ELContext has been created.ExpressionFactorygetExpressionFactory()Returns the JSP container'sExpressionFactoryimplementation for EL use.static JspApplicationContextImplgetInstance(ServletContext context)Returns the JspApplicationContextImpl singleton for the given ServletContext.
-
-
-
Method Detail
-
addELContextListener
public void addELContextListener(ELContextListener listener)
Description copied from interface:jakarta.servlet.jsp.JspApplicationContextRegisters anELContextListenerthat will be notified whenever a newELContextis created.At the very least, any
ELContextinstantiated will have reference to theJspContextunderJspContext.class.- Specified by:
addELContextListenerin interfaceJspApplicationContext- 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 java.lang.IllegalStateException
Description copied from interface:jakarta.servlet.jsp.JspApplicationContextAdds an
ELResolverto 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:
ImplicitObjectELResolverELResolverinstances registered with this methodMapELResolverListELResolverArrayELResolverBeanELResolverScopedAttributeELResolver
- Specified by:
addELResolverin interfaceJspApplicationContext- Parameters:
resolver- an additional resolver- Throws:
java.lang.IllegalStateException- if called after the application'sServletContextListenershave been initialized.
-
getExpressionFactory
public ExpressionFactory getExpressionFactory()
Description copied from interface:jakarta.servlet.jsp.JspApplicationContextReturns the JSP container's
ExpressionFactoryimplementation for EL use.- Specified by:
getExpressionFactoryin interfaceJspApplicationContext- Returns:
- an
ExpressionFactoryimplementation
-
-