• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sakthi Ramasamy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic