Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying an image in jsp using struts

 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this

or

Cheers,
Darryl
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Darryl,
thanks for your response.
I solved the stuff by writing the property value as bean:write.
Thanks
Jowsaki
 
xavier sundar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In case of BLOB image or image from local url(d:/directorypath/filename.jpg).
How to display this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic