Is there a way of getting the HTML from a servlet and writing it to a file?
The simplest way is to implement you own HttpServletResponse and give it to a servlet.
Sorry to get off the subject of this thread, but Andrey's response mentioned something Ive been wondering about.
If I were to implement my own request and response objects, how do I passed them to a servlet running within a servlet engine?
To answer Sam's question..
It might be easier to just connect to the servlet via a URLConnection, get the InputStream and then write that stream to a file.