• 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

Help needed in displaying an Image in the Struts 1.1 View Layer

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We are developing a GUI in JSP, using Struts 1.1 version, which has the following requirement.
Req 1. (Screen 1): Upload the Image from the GUI and store it in the database and add an description for it.
Req 2. (Screen 2): A Combo box should populate the Image Description.
Req 3. (Screen 2): On selection of the Image Description (as described above), the corresponding image should be retrieved from the database and populated in the GUI.

Completed Steps: Req 1 and Req 2.

Help Needed Area: Req 3

Req 3 needs some expert advice on how to do it. we were thinking of using the plain Ajax to enrich the user experience but we were struggling to display the image, since we were running short of time and we were lacking the expertise in it.

I profoundly thank you, if you could share any ideas / help to proceed forward.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Clue #1: How does one normally show images in an HTML page?
 
Sakthi Ramasamy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We use the <img src =""> for the HTML page, but the challenge encountered is that the image is being retrieved as a BLOB Object (Stream). The HTML img tag expects an image from the filesystem and not a stream., I believe.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sakthi Ramasamy wrote:We use the for the HTML page, but the challenge encountered is that the image is being retrieved as a BLOB Object (Stream).


The stream should not be sent to the JSP -- it's not useful there.

The HTML img tag expects an image from the filesystem ...


Incorrect. It expects image data from whatever URL is specified as the value of src. Whether that comes from a file or not is irrelevant. It can, for example, be served as a servlet which reads a blob from the database.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic