aspose file tools
The moose likes Struts and the fly likes Displaying an  image in jsp using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply 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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Displaying an image in jsp using struts
 
Similar Threads
printing images in jsp
Storing Image into database using Struts 1.2 + Hibernate + Oracle
Image is not reloading on JSP page refresh
Sending data via java class
Writing Image from Applet