Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebLogic, Cannot display PDF in JSP

 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we have a web application deployed on Oracle Application server (10.1.3.5.0). We deployed the same
app on WebLogic server (10.3.6.0) and now we have problem with displaying PDF on web page. Here is our code


WebLogic reports "File is corrupted and cannot be repaired. Local\EWH&4u}ik5v".

We have latest Acrobat Reader. Tried a few IE (have version 10) reccomendations -
increase tmp size, delete temp files on leaving IE. But nothing worked.
Do you have any experience with WebLogic ? Could it something be wrong in above code ?

Thanks
 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it myself. The JSP must not contain any HTML code:


 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never use JSPs to stream binary content; that's what servlets are for. JSPs are for creating character output, using them for anything else is a bug waiting to happen. For example, I'm fairly certain that the PDF you downloaded does not have the same number of bytes as the original one.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic