I was having the same trouble.I rewrote the JSP to a Servlet and it worked like a charm.
I was getting a pdf as binary array and trying to display it in browser.First i was getting some weird characters in the display.
Then one fine morning, I was being shown the File Download message(You computer is trying to download a file.Some files maybe potentially harmful. File name, File type, Location . Open,Save,Cancel,More Info blah blah blah).
But curiously the file type was missing , file name was my whole URL ( .../record.jsp?ID=12345) and location was localhost(I am using WSAD and running the JSP on the
test server). When I say Open on the File Download dialog,it started downloading and then errored out saying Could not download from location. On top of that I was getting the outputstream exception in my jsp.
Given below is the jsp code which gave me error.I was writing a scriplet.
If some one is having this same trouble, consider rewriting it to a Servlet.
thanks,
Aparna