Package javax.servlet.jsp

Classes and interfaces for the Core JSP 2.3 API.

See: Description

  • Interface Summary 
    Interface Description
    HttpJspPage
    The HttpJspPage interface describes the interaction that a JSP Page Implementation Class must satisfy when using the HTTP protocol.
    JspApplicationContext
    Stores application-scoped information relevant to JSP containers.
    JspPage
    The JspPage interface describes the generic interaction that a JSP Page Implementation class must satisfy; pages that use the HTTP protocol are described by the HttpJspPage interface.

    Erste Seite von API Java Inhaltsverzeichnis Haut

  • Class Summary 
    Class Description
    ErrorData
    Contains information about an error, for error pages.
    JspContext
    JspContext serves as the base class for the PageContext class and abstracts all information that is not specific to servlets.
    JspEngineInfo
    The JspEngineInfo is an abstract class that provides information on the current JSP engine.
    JspFactory
    The JspFactory is an abstract class that defines a number of factory methods available to a JSP page at runtime for the purposes of creating instances of various interfaces and classes used to support the JSP implementation.
    JspWriter
    The actions and template data in a JSP page is written using the JspWriter object that is referenced by the implicit variable out which is initialized automatically using methods in the PageContext object.
    PageContext
    PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.

    Erste Seite von API Java Inhaltsverzeichnis Haut

  • Exception Summary 
    Exception Description
    JspException
    A generic exception known to the JSP engine; uncaught JspExceptions will result in an invocation of the errorpage machinery.
    JspTagException
    Exception to be used by a Tag Handler to indicate some unrecoverable error.
    SkipPageException
    Exception to indicate the calling page must cease evaluation.

    Erste Seite von API Java Inhaltsverzeichnis Haut

Package javax.servlet.jsp Description

Classes and interfaces for the Core JSP 2.3 API.

The javax.servlet.jsp package contains a number of classes and interfaces that describe and define the contracts between a JSP page implementation class and the runtime environment provided for an instance of such a class by a conforming JSP container.

JSP Page Implementation Object Contract

This section describes the basic contract between a JSP Page implementation object and its container.

The main contract is defined by the classes JspPage and HttpJspPage. The JspFactory class describes the mechanism to portably instantiate all needed runtime objects, and JspEngineInfo provides basic information on the current JSP container. Class JspApplicationContext stores application-scoped information relevant to JSP containers. It was added in JSP 2.1 to support the integration of the unified Expression Language.

None of these classes are intended to be used by JSP page authors; an example of how these classes may be used is included below.

Implicit Objects

The PageContext object and the JspWriter are available by default as implicit objects.

Exceptions

The JspException class is the base class for all JSP exceptions. The JspTagException and SkipPageException exceptions are used by the tag extension mechanism.

For JSP error pages, the ErrorData class encapsulates information about the error.

An Implementation Example

An instance of an implementation dependent subclass of the PageContext abstract base class can be created by a JSP implementation class at the beginning of it's _jspService() method via an implementation default JspFactory.

Here is one example of how to use these classes

 public class foo implements Servlet {

 // ...

public void _jspService(HttpServletRequest request,
                        HttpServletResponse response)
       throws IOException, ServletException {

    JspFactory  factory     = JspFactory.getDefaultFactory();
    PageContext pageContext = factory.getPageContext(
                                        this,
                                        request,
                                        response,
                                        null,  // errorPageURL
                                        false, // needsSession
                                        JspWriter.DEFAULT_BUFFER,
                                        true   // autoFlush
                                );

    // initialize implicit variables for scripting env ...

    HttpSession session = pageContext.getSession();
    JspWriter   out     = pageContext.getOut();
    Object      page    = this;

    try {
        // body of translated JSP here ...
    } catch (Exception e) {
        out.clear();
        pageContext.handlePageException(e);
    } finally {
        out.close();
          factory.releasePageContext(pageContext);
    }
}

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/package-summary.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, javax.servlet.jsp (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.