Getting the HTML and writing to a file

Discussions

Web tier: servlets, JSP, Web frameworks: Getting the HTML and writing to a file

  1. Getting the HTML and writing to a file (3 messages)

    Is there a way of getting the HTML from a servlet and writing it to a file?
  2. The simplest way is to implement you own HttpServletResponse and give it to a servlet.
  3. 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?

    Thanks
  4. 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.