javax.servlet.jsp

Interface JspApplicationContext


  • public interface JspApplicationContext
    Stores application-scoped information relevant to JSP containers.

    The JSP container must create a single instance of JspApplicationContext for each ServletContext instance.

    An instance of JspApplicationContext is obtained by invoking the static JspFactory.getJspApplicationContext(javax.servlet.ServletContext) method, passing the ServletContext of the corresponding web application.

    The JspApplicationContext provides the following services to JSP applications:

    • Allows registration of ELResolvers, which are used to resolve variables in EL expressions contained in JSP pages and tag files.
    • Provides an instance of ExpressionFactory for those applications or frameworks that need to perform programmatic evaluation of EL expressions instead of allowing the JSP container to do it for them.
    • Allows the attachment of ELContextListener instances for notification whenever a new ELContext is created. This is necessary when an application wishes to make custom context objects available to their pluggable ELResolvers.

    Since:
    JSP 2.1
    See Also:
    ServletContext, JspFactory, ELResolver, ExpressionFactory, ELContextListener
    • Method Detail

      • addELResolver

        void addELResolver(ELResolver resolver)
        Adds an ELResolver to affect the way EL variables and properties are resolved for EL expressions appearing in JSP pages and tag files.

        For example, in the EL expression ${employee.lastName}, an ELResolver determines what object "employee" references and how to find its "lastName" property.

        When evaluating an expression, the JSP container will consult a set of standard resolvers as well as any resolvers registered via this method. The set of resolvers are consulted in the following order:

        It is illegal to register an ELResolver after the application has received any request from the client. If an attempt is made to register an ELResolver after that time, an IllegalStateException is thrown.

        This restriction is in place to allow the JSP container to optimize for the common case where no additional ELResolvers are in the chain, aside from the standard ones. It is permissible to add ELResolvers before or after initialization to a CompositeELResolver that is already in the chain.

        It is not possible to remove an ELResolver registered with this method, once it has been registered.

        Parameters:
        resolver - The new ELResolver
        Throws:
        IllegalStateException - if an attempt is made to call this method after all ServletContextListeners have had their contextInitialized methods invoked.
      • getExpressionFactory

        ExpressionFactory getExpressionFactory()
        Returns a factory used to create ValueExpressions and MethodExpressions so that EL expressions can be parsed and evaluated.
        Returns:
        A concrete implementation of the an ExpressionFactory.
      • addELContextListener

        void addELContextListener(ELContextListener listener)
        Registers a ELContextListeners so that context objects can be added whenever a new ELContext is created.

        At a minimum, the ELContext objects created will contain a reference to the JspContext for this request, which is added by the JSP container. This is sufficient for all the default ELResolvers listed in addELResolver(javax.el.ELResolver). Note that JspContext.class is used as the key to ELContext.putContext() for the JspContext object reference.

        This method is generally used by frameworks and applications that register their own ELResolver that needs context other than JspContext. The listener will typically add the necessary context to the ELContext provided in the event object. Registering a listener that adds context allows the ELResolvers in the stack to access the context they need when they do a resolution.

        Parameters:
        listener - The listener to be notified when a new ELContext is created.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/servlet/jsp/JspApplicationContext.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com, JspApplicationContext (Java(TM) EE 7 Specification APIs)

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.