Subject: IPP>PRO new information on POST versus PRINT method

From: Robert Herriot <[email-masked]>
Date: Fri, 13 Mar 1998 12:34:19 -0800

I have now discovered that IPP implementation using Java servlets can be
implemented with either POST or PRINT or any collection of methods we might
want, and it doesn't really matter because of the excellent design of Java
Servlets.

So, I no longer have objections about a PRINT  method based on lack of
support by the webserver.  Now it is more of a network issue and I don't
have enough information to know which is better in that environment.

In case you care about the details of servlets, here they are:

When a servlet Foo is first instantiated its 'init' method is called. It is
instantiated when the web server starts or when the web server detects that
the servlet 'Foo.class' file is new.  In the later case, the web server
calls the 'destroy' method in the running 'Foo' servlet if one is running.

Each time the web server receives a request for '/servlet/Foo', it calls
the 'service' method with two parameters: a request and response object.
Each 'service' call is a separate thread so the servlet can be processing
more than one request. If the servlet overrides the 'service' method, it
can process requests for any method, and it can determine the method via
the request object with the 'getMethod' method. If the servlet doesn't
override the 'service' method, the superclass 'service' method calls
'doGet' for GET, 'doPost' for POST, etc, and it returns an error for the
nonstandard methods. If the servlet overrides 'doGet', it can process GET
methods. If the servlet overrides 'doPost', it can process POST methods.

Bob Herriot

---

From: Tom Hastings <[email-masked]>
Date: Fri, 13 Mar 1998 14:23:33 PST

>methods. If the servlet overrides 'doPost', it can process POST methods.

So what happens if IPP were to use a new method, not GET or POST, such
as PRINT?  Wouldn't this be a "nonstandard" method and so would return
an error as you say?

---

From: Robert Herriot <[email-masked]>
Date: Fri, 13 Mar 1998 15:01:50 -0800

If you implement "service" method in your servlet class, it is called for each
request coming in regardless of the HTTP method. The "doGet" and "doPost"
methods allow you to implement specific HTTP methods without having to test
for
the others that you don't support.  Thus with the current POST method, I
implement "doPost" and not "service" in my "IppServlet" class and let the
superclass "HttpServlet" handle the call to the "service" method.  If we were
to change IPP to use a PRINT method , I would rename my "doPost" method to
"service" and add a check that the method was indeed "PRINT". If we added
several methods, such as PRINT_JOB, CREATE_JOB, etc, I would rename the
"doPost" method to "service" but I would need some additional checks for HTTP
method names.

Bob Herriot