This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes read and display an Image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "read and display an Image" Watch "read and display an Image" New topic
Author

read and display an Image

Lee Grimes
Greenhorn

Joined: Dec 25, 2004
Posts: 3
Hay Everyone,

I would like to read an image file (jpg, gif, etc) from disk and make the image available to a jsp for display. I know the location and name of the image file because I have stored the file name in an EJB when I wrote the image file to disk after the user uploaded the file via a jsp. The image is assocaited with a piece of equipment. Later, when the user is viewing the equipment I have the image name hyerlinked. From this point I have not figured out how to re-produce the image in a jsp on the click.

How does one do that?

TIA for all help!
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Perhaps a hyperlink to the image?


[ December 27, 2004: Message edited by: Joel McNary ]

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Lee Grimes
Greenhorn

Joined: Dec 25, 2004
Posts: 3
A hyper link will not work because the source of the file is not known until run-time when the user selects aa item. I know what item the user is working with when they click on an image link. I do not know how to read the image file and how to get it into the jsp space...
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

If it's a JSP, you can dynamically put the path to the image into the JSP:

 
Consider Paul's rocket mass heater.
 
subject: read and display an Image
 
Similar Threads
Using ImageIO to read a bmp file
To retrieve an image from the database and display it in a JSP page
Uploading an image.
Getting information from a Image file stored on client side
problem with displaying the image from local disk in jsp page