01: /*
02: * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/web/servlet/TKHttpServlet.java,v 1.5 2000/05/22 15:01:36 careck Exp $
03: *
04: */
05: package com.teamkonzept.web.servlet;
06:
07: import java.io.*;
08: import javax.servlet.*;
09: import javax.servlet.http.*;
10:
11: abstract public class TKHttpServlet extends HttpServlet {
12:
13: protected void doGet(HttpServletRequest req,
14: HttpServletResponse resp) throws ServletException,
15: IOException {
16: doRequest(req, resp);
17: }
18:
19: protected void doPost(HttpServletRequest req,
20: HttpServletResponse resp) throws ServletException,
21: IOException {
22: doRequest(req, resp);
23: }
24:
25: protected void doRequest(HttpServletRequest req,
26: HttpServletResponse resp) throws ServletException,
27: IOException {
28: try {
29: resp.setContentType("text/html");
30: main(new ServletInterface(req, resp, this ));
31: } catch (Throwable t) {
32: t.printStackTrace(new PrintStream(new ServletLog(
33: getServletContext())));
34: }
35: }
36:
37: protected abstract void main(ServletInterface s);
38: }
|