• Post Reply Bookmark Topic Watch Topic
  • New Topic

showing image/pdf on browser

 
Subha Rangu
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need a suggestion here.
In a JSP page, I call a method of a Javaclass and get a file dynamically. That file could be any format like, pdf,tif,afp,gif,jpeg etc. I need to show that on the browser.

I tried using <IMG> tag and <EMBED> tag but both of them don't support all the file types.

I was told by someone that I can use JavaScript window.open(file). But I have never done Javascripting so not sure if that could be achieved for dynamic programming.

I have file name as a string.

Please suggest me the best way to show it on the browser and also, that should be having a form which contains a close button as well.

Thanks in advance,
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please suggest me the best way to show it on the browser


Not with a JSP. JSPs are designed to deilver text-based responses and are a really bad technology choice for non-text content.

Explore the wonderful world of servlets.
[ September 17, 2004: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!