View Javadoc

    1   /**
    2    *
    3    * Copyright 2003-2004 The Apache Software Foundation
    4    *
    5    *  Licensed under the Apache License, Version 2.0 (the "License");
    6    *  you may not use this file except in compliance with the License.
    7    *  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   *  Unless required by applicable law or agreed to in writing, software
    12   *  distributed under the License is distributed on an "AS IS" BASIS,
    13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   *  See the License for the specific language governing permissions and
    15   *  limitations under the License.
    16   */
    17
    18  //
    19  // This source code implements specifications defined by the Java
    20  // Community Process. In order to remain compliant with the specification
    21  // DO NOT add / change / or delete method signatures!
    22  //
    23
    24  package javax.servlet.jsp;
    25
    26  import javax.servlet.Servlet;
    27
    28  /**
    29   * The JspPage interface describes the generic interaction that a JSP Page
    30   * Implementation class must satisfy; pages that use the HTTP protocol
    31   * are described by the HttpJspPage interface.
    32   *
    33   * <p><B>Two plus One Methods</B>
    34   * <p>
    35   * The interface defines a protocol with 3 methods; only two of
    36   * them: jspInit() and jspDestroy() are part of this interface as
    37   * the signature of the third method: _jspService() depends on
    38   * the specific protocol used and cannot be expressed in a generic
    39   * way in Java.
    40   * <p>
    41   * A class implementing this interface is responsible for invoking
    42   * the above methods at the appropriate time based on the
    43   * corresponding Servlet-based method invocations.
    44   * <p>
    45   * The jspInit() and jspDestroy() methods can be defined by a JSP
    46   * author, but the _jspService() method is defined automatically
    47   * by the JSP processor based on the contents of the JSP page.
    48   *
    49   * <p><B>_jspService()</B>
    50   * <p>
    51   * The _jspService()method corresponds to the body of the JSP page. This
    52   * method is defined automatically by the JSP container and should never
    53   * be defined by the JSP page author.
    54   * <p>
    55   * If a superclass is specified using the extends attribute, that
    56   * superclass may choose to perform some actions in its service() method
    57   * before or after calling the _jspService() method.  See using the extends
    58   * attribute in the JSP_Engine chapter of the JSP specification.
    59   * <p>
    60   * The specific signature depends on the protocol supported by the JSP page.
    61   *
    62   * <pre>
    63   * public void _jspService(<em>ServletRequestSubtype</em> request,
    64   *                             <em>ServletResponseSubtype</em> response)
    65   *        throws ServletException, IOException;
    66   * </pre>
    67   */
    68
    69
    70  public interface JspPage extends Servlet {
    71
    72      /**
    73       * The jspInit() method is invoked when the JSP page is initialized. It
    74       * is the responsibility of the JSP implementation (and of the class
    75       * mentioned by the extends attribute, if present) that at this point
    76       * invocations to the getServletConfig() method will return the desired
    77       * value.
    78       *
    79       * A JSP page can override this method by including a definition for it
    80       * in a declaration element.
    81       *
    82       * A JSP page should redefine the init() method from Servlet.
    83       */
    84      public void jspInit();
    85
    86      /**
    87       * The jspDestroy() method is invoked when the JSP page is about to be
    88       * destroyed.
    89       *
    90       * A JSP page can override this method by including a definition for it
    91       * in a declaration element.
    92       *
    93       * A JSP page should redefine the destroy() method from Servlet.
    94       */
    95      public void jspDestroy();
    96
    97  }