• Post Reply Bookmark Topic Watch Topic
  • New Topic

href link from jsp file to jsp file wich content is "application/pdf"

 
Youssef Ghalem
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody , i am a brand new java programmer and in my project i got this problem , actually let me malke you on the tracks
i have made a jsp file wich via an outputstreamer displays a pdf file in the browser but the jsp file in question has in his header this code : response.setContentType( "application/pdf" );

in the other jsp file i have made an href link in this way : " "<a href=\"pdf_to_screan.jsp \">" +Display_filepath(result.getString(7))+"</a>" and when i try to execute the programm a message shows up and it is written " file dont begin by %PDF"
I tried to execute the jsp file wich countains pdf alone , and it works perfectly , but via the href link the message shows up

if anyone could help this rookie pleeeeease ???

thank you very much
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For all practical purposes, JSPs can't be used to create binary content (like a PDF). Use a servlet instead, and make sure to set the correct content type header.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!