• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to show image from database

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to everyone.

I have succesfully upload an image to a database. Now comes the hardest part: display this image..
I load in the session a bean named "test" with attribute "image" (type byte[]) in wich the image is savad. Now I can't figure it out on how to display this image into the jsp.

I'd like to do something like this:



But obviously it does'nt work..:P

Anyone can help?

Thanks
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Search the web for "image servlet". You can do the same thing with an action if you want, just return null instead of an action forward.
 
andrea casini
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:Search the web for "image servlet". You can do the same thing with an action if you want, just return null instead of an action forward.



LOL.. I found also my topic..:D
Ok.. So I create this action:


And in the jsp I put this:


It work. But I want to display this image without typing on a link and I'd like to render the image (minimize it to a specific size).
I tried returning null and use <html:image src="/viewImage.do"/> but nothing. Why??
reply
    Bookmark Topic Watch Topic
  • New Topic