IPP>PRO new information on POST versus PRINT method

IPP>PRO new information on POST versus PRINT method

Robert Herriot robert.herriot at Eng.Sun.COM
Fri Mar 13 18:01:50 EST 1998


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




At 02:23 PM 3/13/98 , Tom Hastings wrote:
>At 12:34 03/13/1998 PST, Robert Herriot wrote:
>>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=A0 method based on lack of
>>support by the webserver.=A0 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.=A0 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.
>
>So what happens if IPP were to use a new method, not GET or POST, such
>as PRINT?=A0 Wouldn't this be a "nonstandard" method and so would return
>an error as you say?
>
>>
>>Bob Herriot
>>
>>
>>
>>
>>
>=20



More information about the Ipp mailing list