A Generic HTTP Superclass
imports javax.servlet.*;
imports javax.servlet.http.*;
imports javax.servlet.jsp.*;
* An example of a superclass for an HTTP JSP class
abstract class ExampleHttpSuper implements HttpJspPage {
private ServletConfig config;
final public void init(ServletConfig config) throws ServletException {
this.config = config;
final public ServletConfig getServletConfig() {
return config;
// This one is not final so it can be overridden by a more precise method
public String getServletInfo() {
return  A Superclass for an HTTP JSP ; // maybe better?
final public void destroy() {
* The entry point into service.
final public void service(ServletRequest req, ServletResponse res)
throws ServletException, IOException {
// casting exceptions will be raised if an internal error.
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
_jspService(request, resonse);
* abstract method to be provided by the JSP processor in the subclass
* Must be defined in subclass.
abstract public void _jspService(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException;
JavaServer Pages 1.1 Specification  
November 30, 1999

JSP Web Hosting JavaServer Pages Specifications JSP Hosting Business web hosting division of Vision Web Hosting Inc. All rights reserved.