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