Forum Moderators: mack
You need to change the type of response in your JSP to application/pdf. In the code of the JSP, you need to open the file and get a stream which will give you an array of data from that PDF. Your response object has a method that allows you to write a byte array to the client.
I think it would look like this. (Note that I haven't done Java for a while, so the syntax is probably pretty lousy.):
<%
...
response.setContentType("application/pdf");
FileInputStream fs = new FileInputStream("c:\allPDFs\mySecretPDF.pdf");
byte[] b = new byte[];
fs.read(b);
OutputStream os = response.getOutputStream();
os.write(b);
os.flush();
...
%>
Good luck!
g.
You might also let the container do the reading and writing instead of doing it yourself.
Use request dispatcher's forward method.