• 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

pictures in a jsp

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i need some idea.
i hava a database with a table.
that table contain two columns,name and picture(gif).
the table is updated daily i.e it contains 'n' number of pictures.
i have to display these pictures in a jsp.
but i have a condition that at a time i display 4 pictures.
so i have to keep page number in the bottom of the page(that is dynamically created according to number of pictures)to display all the pictures.
so how i will do.
please give some idea.
thank you.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would start by making a servlet that can stream binary data to a browser.
Have it accept an ID for the image in your database as a form parameter, querystring variable, or part of the URL.

Then write an object that can pull the image data from the database and return it to your servlet for streaming.

Note: Don't try to stream binary data from a JSP.
JSP wasn't meant to do that sort of thing and you'll save yourself a lot of headaches if you start out building it as a servlet.

I have a sample app that covers some of what you'll need to do.
http://simple.souther.us
Look for SimpleStream.

It reads the images from file but it wouldn't be difficult to modify it to read from a database instead.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic