I have a page in JSP that list some file that could be downloaded by a user. Thoses files are not on the local server, they are on a remote file server.
When the use
If forced to use jsp (and not a servlet), you may take a look at this how-to
It uses the ServletOutputStream, which is more appropriate for binary content, rather than a JspWriter.
ServletOutputStream
JspWriter
Also note the settings for trimming the whitespaces.