This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes Displaying thumb nail image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Displaying thumb nail image " Watch "Displaying thumb nail image " New topic
Author

Displaying thumb nail image

Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
I have an HTMl page and I am storing the image as a blob in DB.While displaying on the browser I need to display the image as a thumb nail( not the original size).How do i do this using servlets
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

You could write a servlet that retrieves the image data from the database and resizes it to your desired "thumbnail" size using an imaging library (JAI perhaps?). The servlet would set the appropriate content type headers and return the resized image data as the response.
The servlet would be referenced from the html page using the img tag just like any other image.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying thumb nail image
 
Similar Threads
Learning a new tool
GPS Co-ordinates
Refererancing Servlet from my JSP
GPS-Cordinates
retrieve size of an image