This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
hi, i want to display the content of a pdf file in the browser when requested for a jsp file.i am reading the content of pdf in jsp and using the servletoutput stream i am displaying it. But it is displaying as bytes like 0 1 .... . not the original content.
how to display the original content instead of bytes ?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35250
7
posted
0
JSP pages are not meant to be used to emit binary data. While it's theoretically possible, practical considerations make it unfeasible. Convert the JSP into a servlet, and things should go much smoother.
Originally posted by raj baig: Even the jsp will convert to a servlet ,why can't a jsp.
Yes, a servlet can do everything a JSP page can. But from that it does not follow that a JSP can do everything a servlet can.
raj baig
Ranch Hand
Joined: Jul 11, 2006
Posts: 96
posted
0
Thank you all
" Help get's you when you need it " ---> True.
Maki Jav
Ranch Hand
Joined: May 09, 2002
Posts: 423
posted
0
Raj baig thanks ;)
Maki Jav
Rahul Bhattacharjee
Ranch Hand
Joined: Nov 29, 2005
Posts: 2300
posted
0
Originally posted by raj baig: Even the jsp will convert to a servlet ,why can't a jsp.
jsp's should used only for the view part.More of html.In your case you will not have any html part , rather bytes of pdf would be flushed to the browser.In that case better use an servlet.