It's not a secret anymore!
The moose likes Struts and the fly likes show image with displayTag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "show image with displayTag" Watch "show image with displayTag" New topic

show image with displayTag

peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

I have database with following column:
blob pic
startDate date
endDate date
description String
now i want to show these data with can i use column decorator to retrive images from database and show with displaytag.
please help me.
thank you.
peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

is there any java programmer?
please help me.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
I could imagine that the big, bold font is turning some people off who might otherwise be willing to help.

DisplayTag is a JSP tag library - its output is HTML. As such, it can't handle images. You'll need to store the BLOBs as files in a publicly accessible directory, and then DisplayTag can create links to them. Or you can keep the BLOBs somewhere in memory (maybe in the application context), and then write a servlet that streams them dynamically.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689


you can display it in display tag but inside display tag you have to call one servlet that is image servlet. which is basically give response as byte and display it in display coulomb.


Something like this.............

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
I agree. Here's the link:
subject: show image with displayTag
It's not a secret anymore!