Originally posted by William Brogden:
Where in the world did the idea that you can't doHead, doPut or doTrace come from???
Look at the HttpServlet class API
It has the methods for all of DELETE, GET, HEAD, OPTIONS, POST, PUT, and TRACE - the service method directs a request accordingly.
Bill
Originally posted by William Brogden:
My understanding of the use of the FORM tag is that METHOD can only be GET or POST - I bet that if you use HEAD the browser does a GET by default. HEAD does not make sense as a form method anyway.
You would have to use a HttpURLConnection to do a HEAD request.
Bill
Janelle Goldsmith wrote:I want to call the HEAD method on a servlet.
If in my HTML code, I specify -
<form name="testHead" action="/servlet/servletName" method="HEAD">
and the servlet handles the HEAD method in the sense that the doGet() method returns if the method type is HEAD.
When I run it, the servlet returns the code retured by the entire doGet() method. This shows that the doGet() method does not realize that it is a HEAD method and it should return back without procesing further.
The application server is Tomcat 4.0.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.