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:
18: package org.apache.jasper.runtime;
19:
20: import java.io.IOException;
21:
22: import javax.servlet.ServletConfig;
23: import javax.servlet.ServletException;
24: import javax.servlet.http.HttpServlet;
25: import javax.servlet.http.HttpServletRequest;
26: import javax.servlet.http.HttpServletResponse;
27: import javax.servlet.jsp.HttpJspPage;
28: import javax.servlet.jsp.JspFactory;
29:
30: import org.apache.jasper.compiler.Localizer;
31:
32: /**
33: * This is the super class of all JSP-generated servlets.
34: *
35: * @author Anil K. Vijendran
36: */
37: public abstract class HttpJspBase extends HttpServlet implements
38: HttpJspPage
39:
40: {
41:
42: protected HttpJspBase() {
43: }
44:
45: public final void init(ServletConfig config)
46: throws ServletException {
47: super .init(config);
48: jspInit();
49: _jspInit();
50: }
51:
52: public String getServletInfo() {
53: return Localizer.getMessage("jsp.engine.info");
54: }
55:
56: public final void destroy() {
57: jspDestroy();
58: _jspDestroy();
59: }
60:
61: /**
62: * Entry point into service.
63: */
64: public final void service(HttpServletRequest request,
65: HttpServletResponse response) throws ServletException,
66: IOException {
67: _jspService(request, response);
68: }
69:
70: public void jspInit() {
71: }
72:
73: public void _jspInit() {
74: }
75:
76: public void jspDestroy() {
77: }
78:
79: protected void _jspDestroy() {
80: }
81:
82: public abstract void _jspService(HttpServletRequest request,
83: HttpServletResponse response) throws ServletException,
84: IOException;
85: }
|