wood burning stoves 2.0*
The moose likes Struts and the fly likes Displaying an  image in jsp using struts 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 » Frameworks » Struts
Bookmark "Displaying an  image in jsp using struts" Watch "Displaying an  image in jsp using struts" New topic
Author

Displaying an image in jsp using struts

Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Hi All,
Displaying image in jsp using struts, My requirement is that I have an URL which will dynamically get it from DB using DAO / VO mechanism. I have to add that URL in image tag, say url1 has the real content url

<html:image property="url1" src="url1" name="contentVO" />
is this correct syntax?
pls help me out of image tag.
Thanks
Cheers
jowsaki
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Hi there,
There is a difference between <html:image /> and <html:img />. The former is used to render an image-like submit button. The latter is used to render a graphic image.
The latter can be implemented in a number of ways:

or:

or:

Cheers,
Darryl
Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Hi Darryl,
Tks for your reply..
But in my case, I have the path of the image is in property field (url1 = http://localhost/xyz.gif) now I need to pass this value in img src="" field.
Can you pls advise me.
thanks
cheers
jowsaki
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Try this

or

Cheers,
Darryl
Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Sorry Darryl,
thanks for your response.
I solved the stuff by writing the property value as bean:write.
Thanks
Jowsaki
xavier sundar
Greenhorn

Joined: Jan 09, 2013
Posts: 2
Hi,
In case of BLOB image or image from local url(d:/directorypath/filename.jpg).
How to display this.
 
jQuery in Action, 2nd edition
 
subject: Displaying an image in jsp using struts
 
Similar Threads
Storing Image into database using Struts 1.2 + Hibernate + Oracle
Sending data via java class
printing images in jsp
Writing Image from Applet
Image is not reloading on JSP page refresh