• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

doHead() example needed

 
Ranch Hand
Posts: 31
Hibernate Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,
I know that Head method works exactly like the get method but it only returns the HTTP header information without any body.
However I have never seen any example till now in which doHead() is overrriden.
Hence Could you please let me know
1) How to print the HTTP Header information using doHead() i.e.what whould be defintion of overriden doHead() ?
2) How to make a HEAD request from the browser ?

Many thanks is advance !
Regards,
Somesh
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Somesh I am not a pro at this, but I think you cannot make head requests from a browser. For this I think you will have to make a small program and connect to the servlet using URL class or making a SocketConnection.

As far as doHead method is concerned, I have again not read the specs but in one of my books I read that doHead internally calls doGet and sends back only the response headers. This may be wrong as I have not read about this in any other books...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JavaScript XMLHttpRequest object can generate HEAD requests; see the AJAX section of http://faq.javaranch.com/java/JavascriptLinks for some pointers. (And yes, HEAD is like GET without the response body.)
 
Somesh Rathi
Ranch Hand
Posts: 31
Hibernate Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THanks Ankit & Ulf for the reply. I'll try to find out details & will get back to you for more clarification
Thanks ,
Somesh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic