Yes, I missed that obvious refactoring on the doGet/doHead.

Actually, looking at the servlet spec, doHead by default calls doGet with a null output stream.  Since are already computing the response content and discarding it, its cleaner to just use the default doHead implementation.