The attached jsp worked for me. A jsp is like an inside out servlet so any characters or newlines or anything outside your jsp scriptlet will be output by the server. This includes newlines after scriptlet etc. If you are trying to return a binary file with a jsp it will corrupt the file. I think this may be causing your issue.
Regards,
Christian