This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes BEA/Weblogic and the fly likes WebLogic, Cannot display PDF in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WebLogic, Cannot display PDF in JSP" Watch "WebLogic, Cannot display PDF in JSP" New topic
Author

WebLogic, Cannot display PDF in JSP

Jiri Nejedly
Ranch Hand

Joined: Oct 22, 2002
Posts: 81
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

Joined: Oct 22, 2002
Posts: 81
I found it myself. The JSP must not contain any HTML code:


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41571
    
  54
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.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebLogic, Cannot display PDF in JSP