I believe that only GET and POST methods are acceptable for <FORM> tag.
Method HEAD exists only for internal use by browser so before retrieving
huge image file from server it can send HEAD request, verify that file in
cache and on server has the same date/size and display it to you.
So basically your browser just ignores method="HEAD" and by default uses
GET.
George.
> -----Original Message-----
> From: Matthew George [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, December 28, 1999 3:18 PM
> To: [EMAIL PROTECTED]
> Subject: HEAD and POST method clarification
>
> Hello,
>
> I am new to servlets and as a first step in learning servlets, I have
> purchased Jason Hunter's book and I am going through it. I need a few more
> tips in understanding the example 2-3 the source code of which is given at
> http://www.servlets.com/book/examples/ch02/Hello.java.
>
> Along with the explanation on page 27 it is stated that (or so I
> understand) if the method HEAD is used to invoke the servlet, then the
> servet will return without printing out the output "Hello so & so" . I
> changed the HTML form that invokes the servlet as <FORM METHOD=HEAD
> ACTION="/servlet/Hello"> from <FORM METHOD=GET ACTION="/servlet/Hello">.
> But I still get the output "Hello so & so". As a part of debugging I used
> System.out.println(req.getMethod()) and find that the method that is
> invoked is GETand not HEAD.
>
> Also if I change the HTML form that invokes the servlet as <FORM
> METHOD=POST ACTION="/servlet/Hello"> from <FORM METHOD=GET
> ACTION="/servlet/Hello"> without having a doPost() method, I did not get
> the error message that says that the requested URL does not support that
> method but got "A network error occurred while Netscape was receiving
> data, Connection reset by user".
>
> I am using JSDK2.1 and am running the servlet engine that comes along with
> it and testing these examples locally.
>
> I would appreciate very much any help offered for the above.
>
> Regards
> Mathew A George
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html