From: Sam Ruby Date: Sun, 30 Jul 2000 04:50:31 +0000 (+0000) Subject: Refactor in support of subclassing X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ca1c611b3f53c19cf8ce96f84ded4028bb1f0fd;p=php Refactor in support of subclassing --- 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();