It's not a secret anymore!
The moose likes Servlets and the fly likes Showing .tif  images on browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Showing .tif  images on browser" Watch "Showing .tif  images on browser" New topic

Showing .tif images on browser

asheesh talwar
Ranch Hand

Joined: Dec 10, 2000
Posts: 31
Currently I am doing one module where in I have to show the tif images (.tif extension) on the browser through servlet. I was wondering if there are any Java API's which I can use to show them. I am using JSP on the front end.
Thanx very much!
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
You don't need a special API to send binary data to the browser from a servlet (not a JSP). Just make sure you set the content type and content length in the response.
Ranch Hand

Joined: Jul 06, 2001
Posts: 54
Hi All,
You can also embed the URL of the tif image as a static link within the JSP page.
This way, when the browser downloads the JSP page content, it would find the tif URL, and would request it from the web server. All you need is to put the tif image in the web server at the correct location relativly to the web server document root (not the web container document root).

Omar IRAQI Houssaini
asheesh talwar
Ranch Hand

Joined: Dec 10, 2000
Posts: 31
Bill / Omar
The tif image needs to be converted before we can show them on the browser. I have tried that before putting the query. If you want I can send U the image. Thanx for the reply.
I agree. Here's the link:
subject: Showing .tif images on browser
It's not a secret anymore!