I never have seen examples online, all were local, so I can't continue.Java runs on the server and its on the server that you want the file to be created. So it IS a local file you will be creating.
Agreed. No reason what-so-ever to have to store some static html page, especially to access data stored in a db. Store the data in the db, and use some other db fields (or even an entire other table) for storing "reference" information that would be needed for the html display and then generate the html live, whether with Servlet, JSP, JSF, whatever.