001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    //
021    // This source code implements specifications defined by the Java
022    // Community Process. In order to remain compliant with the specification
023    // DO NOT add / change / or delete method signatures!
024    //
025    
026    package javax.servlet.jsp;
027    
028    import javax.servlet.*;
029    
030    /**
031     * The JspPage interface describes the generic interaction that a JSP Page
032     * Implementation class must satisfy; pages that use the HTTP protocol
033     * are described by the HttpJspPage interface.
034     *
035     * <p><B>Two plus One Methods</B>
036     * <p>
037     * The interface defines a protocol with 3 methods; only two of
038     * them: jspInit() and jspDestroy() are part of this interface as
039     * the signature of the third method: _jspService() depends on
040     * the specific protocol used and cannot be expressed in a generic
041     * way in Java.
042     * <p>
043     * A class implementing this interface is responsible for invoking
044     * the above methods at the appropriate time based on the
045     * corresponding Servlet-based method invocations.
046     * <p>
047     * The jspInit() and jspDestroy() methods can be defined by a JSP
048     * author, but the _jspService() method is defined automatically
049     * by the JSP processor based on the contents of the JSP page.
050     *
051     * <p><B>_jspService()</B>
052     * <p>
053     * The _jspService()method corresponds to the body of the JSP page. This
054     * method is defined automatically by the JSP container and should never
055     * be defined by the JSP page author.
056     * <p>
057     * If a superclass is specified using the extends attribute, that
058     * superclass may choose to perform some actions in its service() method
059     * before or after calling the _jspService() method.  See using the extends
060     * attribute in the JSP_Engine chapter of the JSP specification.
061     * <p>
062     * The specific signature depends on the protocol supported by the JSP page.
063     *
064     * <pre>
065     * public void _jspService(<em>ServletRequestSubtype</em> request,
066     *                             <em>ServletResponseSubtype</em> response)
067     *        throws ServletException, IOException;
068     * </pre>
069     */
070    
071    
072    public interface JspPage extends Servlet {
073    
074        /**
075         * The jspInit() method is invoked when the JSP page is initialized. It
076         * is the responsibility of the JSP implementation (and of the class
077         * mentioned by the extends attribute, if present) that at this point
078         * invocations to the getServletConfig() method will return the desired
079         * value.
080         *
081         * A JSP page can override this method by including a definition for it
082         * in a declaration element.
083         *
084         * A JSP page should redefine the init() method from Servlet.
085         */
086        public void jspInit();
087    
088        /**
089         * The jspDestroy() method is invoked when the JSP page is about to be
090         * destroyed.
091         * 
092         * A JSP page can override this method by including a definition for it
093         * in a declaration element.
094         *
095         * A JSP page should redefine the destroy() method from Servlet.
096         */
097        public void jspDestroy();
098    
099    }