Alex,
Welcome to CodeRanch!
Most people would use a
Servlet for this rather than a JSP since you aren't creating the content with a template. Regardless, you need to set the content type to PDF so the browser knows this isn't HTML content. You can see
examples here. Right now, you are getting a mess of binary, because the browser is trying to display it as text.