From 4ca1c611b3f53c19cf8ce96f84ded4028bb1f0fd Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sun, 30 Jul 2000 04:50:31 +0000 Subject: [PATCH] Refactor in support of subclassing --- sapi/servlet/servlet.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sapi/servlet/servlet.java b/sapi/servlet/servlet.java index 3ed5e19222..7f6ac3fdc2 100644 --- a/sapi/servlet/servlet.java +++ b/sapi/servlet/servlet.java @@ -102,7 +102,7 @@ public class servlet extends HttpServlet { e.printStackTrace(System.err); } } else { - response.getWriter().println(data); + write(data); } } } catch (IOException e) { @@ -152,15 +152,13 @@ public class servlet extends HttpServlet { } public void service(HttpServletRequest request, - HttpServletResponse response) + HttpServletResponse response, + String contextPath) throws ServletException { this.request=request; this.response=response; - String servletPath=request.getServletPath(); - String contextPath=getServletContext().getRealPath(servletPath); - send(request.getMethod(), request.getQueryString(), request.getRequestURI(), contextPath, request.getContentType(), request.getContentLength(), @@ -173,6 +171,15 @@ public class servlet extends HttpServlet { } } + public void service(HttpServletRequest request, + HttpServletResponse response) + throws ServletException + { + String servletPath=request.getServletPath(); + String contextPath=getServletContext().getRealPath(servletPath); + service(request, response, contextPath); + } + public void destroy() { if (0 == --startup_count) shutdown(); super.destroy(); -- 2.50.1