1 5 package com.teamkonzept.web.servlet; 6 7 import java.io.*; 8 import javax.servlet.*; 9 import javax.servlet.http.*; 10 11 abstract public class TKHttpServlet extends HttpServlet { 12 13 protected void doGet( HttpServletRequest req, HttpServletResponse resp ) 14 throws ServletException, IOException 15 { 16 doRequest( req, resp ); 17 } 18 19 protected void doPost( HttpServletRequest req, HttpServletResponse resp ) 20 throws ServletException, IOException 21 { 22 doRequest( req, resp ); 23 } 24 25 protected void doRequest( HttpServletRequest req, HttpServletResponse resp ) 26 throws ServletException, IOException 27 { 28 try { 29 resp.setContentType("text/html"); 30 main( new ServletInterface( req, resp, this ) ); 31 } 32 catch( Throwable t ) { 33 t.printStackTrace( new PrintStream( new ServletLog( getServletContext() ) ) ); 34 } 35 } 36 37 protected abstract void main( ServletInterface s ); 38 } 39 40 | Popular Tags |