This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Display pdf file contents through jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Bookmark "Display pdf file contents through jsp" Watch "Display pdf file contents through jsp" New topic

Display pdf file contents through jsp

Ramesh Bhagasra

Joined: Nov 21, 2003
Posts: 8
I want to display the pdf file contents to the web page through jsp. Currently i am trying to it using response object and setting its content type to application/pdf but the explorer does not show any output. what i have to do for initialising the pdf application and displaying the contents stored in my oracle databse as blob field. Please help me out........
Sona Bhavani

Joined: Nov 12, 2003
Posts: 6
First check out if you are able to open pdf files independantly in your browser thro File > Open menu.If that works fine then you should have no problems viewing pdf files thro jsp.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63195

JSPs are designed to return text data. For binary data such as PDF files, servlets are a much better choice.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ramesh Bhagasra

Joined: Nov 21, 2003
Posts: 8
can u give me some code idea for that and plz tell me can i use servlet as a bean in my jsp using usebean tag
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 160
you can try and see wheteher it works or not , well it would be better if you use servlets.

jasmine kaur
I agree. Here's the link:
subject: Display pdf file contents through jsp
It's not a secret anymore!