summaryrefslogtreecommitdiff
path: root/sapi/servlet/servlet.java
diff options
context:
space:
mode:
authorSam Ruby <rubys@php.net>2000-07-30 04:50:31 +0000
committerSam Ruby <rubys@php.net>2000-07-30 04:50:31 +0000
commit4ca1c611b3f53c19cf8ce96f84ded4028bb1f0fd (patch)
tree101afe523ec5b949e42eccd20c02c7f35452685d /sapi/servlet/servlet.java
parenta2343295352005e8b8427b8a63faedd09cc307d1 (diff)
downloadphp-git-4ca1c611b3f53c19cf8ce96f84ded4028bb1f0fd.tar.gz
Refactor in support of subclassing
Diffstat (limited to 'sapi/servlet/servlet.java')
-rw-r--r--sapi/servlet/servlet.java17
1 files 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();