Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doHead( ) functionality doubt?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
doHead() method is used to check whether file is modified or not?

what it means...which will check which one? is it one servlet to check whether another servlet modified or not? By checking what it will do? modified or not is compared to the last accessed time stamp. is this method used for development purpose only?

if another servlet is modified from last access then what the current servlet does? will it reload that?

Can somebody clarify this.

yamini
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HEAD action returns only the headers for a resource and not the resource itself, be it a HTML page,a servlet or any servable content for that matter.

One typical usage of HEAD action is to retrieve the header of a file and read the last modified time stamp. Based on this, the client software can decide whether to re-download the new copy or continue with the cached version of the resource.

The doHead() method can be used to capture such HEAD requests so that you can read/alter the headers that are being sent to the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic