01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package javax.servlet.jsp;
18:
19: import javax.servlet.*;
20:
21: /**
22: * The JspPage interface describes the generic interaction that a JSP Page
23: * Implementation class must satisfy; pages that use the HTTP protocol
24: * are described by the HttpJspPage interface.
25: *
26: * <p><B>Two plus One Methods</B>
27: * <p>
28: * The interface defines a protocol with 3 methods; only two of
29: * them: jspInit() and jspDestroy() are part of this interface as
30: * the signature of the third method: _jspService() depends on
31: * the specific protocol used and cannot be expressed in a generic
32: * way in Java.
33: * <p>
34: * A class implementing this interface is responsible for invoking
35: * the above methods at the appropriate time based on the
36: * corresponding Servlet-based method invocations.
37: * <p>
38: * The jspInit() and jspDestroy() methods can be defined by a JSP
39: * author, but the _jspService() method is defined automatically
40: * by the JSP processor based on the contents of the JSP page.
41: *
42: * <p><B>_jspService()</B>
43: * <p>
44: * The _jspService()method corresponds to the body of the JSP page. This
45: * method is defined automatically by the JSP container and should never
46: * be defined by the JSP page author.
47: * <p>
48: * If a superclass is specified using the extends attribute, that
49: * superclass may choose to perform some actions in its service() method
50: * before or after calling the _jspService() method. See using the extends
51: * attribute in the JSP_Engine chapter of the JSP specification.
52: * <p>
53: * The specific signature depends on the protocol supported by the JSP page.
54: *
55: * <pre>
56: * public void _jspService(<em>ServletRequestSubtype</em> request,
57: * <em>ServletResponseSubtype</em> response)
58: * throws ServletException, IOException;
59: * </pre>
60: */
61:
62: public interface JspPage extends Servlet {
63:
64: /**
65: * The jspInit() method is invoked when the JSP page is initialized. It
66: * is the responsibility of the JSP implementation (and of the class
67: * mentioned by the extends attribute, if present) that at this point
68: * invocations to the getServletConfig() method will return the desired
69: * value.
70: *
71: * A JSP page can override this method by including a definition for it
72: * in a declaration element.
73: *
74: * A JSP page should redefine the init() method from Servlet.
75: */
76: public void jspInit();
77:
78: /**
79: * The jspDestroy() method is invoked when the JSP page is about to be
80: * destroyed.
81: *
82: * A JSP page can override this method by including a definition for it
83: * in a declaration element.
84: *
85: * A JSP page should redefine the destroy() method from Servlet.
86: */
87: public void jspDestroy();
88:
89: }
|