Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

WebLogic, Cannot display PDF in JSP

 
Ranch Hand
Posts: 92
  • 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: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it myself. The JSP must not contain any HTML code:


 
Rancher
Posts: 43011
76
  • 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.
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!