]> granicus.if.org Git - php/commitdiff
Refactor in support of subclassing
authorSam Ruby <rubys@php.net>
Sun, 30 Jul 2000 04:50:31 +0000 (04:50 +0000)
committerSam Ruby <rubys@php.net>
Sun, 30 Jul 2000 04:50:31 +0000 (04:50 +0000)
sapi/servlet/servlet.java

index 3ed5e1922271fa16961d7bb8fd9c26c01b83d954..7f6ac3fdc2320497e71fc26a3ff65ed06df564c9 100644 (file)
@@ -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();