This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Images in Struts

 
Raza Khan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have images stored in the database. What would be the proper way to fetch these images. I have used <c ut tag in JSP but unable to get images.
How can i do this?? in struts which option is better--- 1) displaying images from database or 2) creating new image folder to keep image files

Thanks
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless there is a compelling reason to store images in the database, I would use the file system and standard HTML IMG tags.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd agree with Joe, but if that isn't possible, you can stream images to the response through an action or a servlet and access them via an IMG tag.
 
Raza Khan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe and David... but is there any <c: tag to display images like <c ut .. etc...

thnks again

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there's the <img...> tag. If you're streaming the image from the DB through an action or servlet you have the "src" attribute be the appropriate servlet/action URL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic