Re: Displaying images from database (BLOB) using the tag

2011-05-16 Thread Maurizio Cucchiara
Take a look at http://struts.apache.org/2.x/docs/stream-result.html On 16 May 2011 18:41, Ilya Kazakevich wrote: > You need action (or servlet) that will read image from db and write image to > the output stream setting appropriate conent-type. > Than you do: > > > > > > Ilya Kazakevich, > Devel

RE: Displaying images from database (BLOB) using the tag

2011-05-16 Thread Ilya Kazakevich
You need action (or servlet) that will read image from db and write image to the output stream setting appropriate conent-type. Than you do: Ilya Kazakevich, Developer JetBrains Inc http://www.jetbrains.com "Develop with pleasure!" -Original Message- From: Saeed Najahi [mailto:najah

Re: Displaying images from database (BLOB) using the tag

2011-05-16 Thread Chris Pratt
Stream it to the ServletOutputStream and return null from the action. (*Chris*) On May 16, 2011 8:48 AM, "Saeed Najahi" wrote: > hello guys, can anyone kindly tell me how can i display an image fetched > from a database using the tag? thanks in advance. > > -- >

Re: Displaying images from database.

2006-07-25 Thread Niall Pemberton
e else? M- - Original Message - From: "C. Grobmeier" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, July 25, 2006 9:55 AM Subject: Re: Displaying images from database. > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > The

Re: Displaying images from database.

2006-07-25 Thread C. Grobmeier
ssage - > From: "C. Grobmeier" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Tuesday, July 25, 2006 9:55 AM > Subject: Re: Displaying images from database. > > > Then how can one have an Java-Object, let's say Person.java. Per

Re: Displaying images from database.

2006-07-25 Thread Martin Gainty
meier" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, July 25, 2006 9:55 AM Subject: Re: Displaying images from database. > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Then how can one have an Java-Object, let's say Person.java. Person

Re: Displaying images from database.

2006-07-25 Thread C. Grobmeier
awful. If you are not the intended recipient of the mail, kindly > intimate the author of the mail and delete the same. > > > - Original Message - > From: [EMAIL PROTECTED] >

Re: Displaying images from database.

2006-07-25 Thread Thomas Joseph
PROTECTED] To: user@struts.apache.org Sent: Tuesday, July 25, 2006 6:37 PM Subject: RE: Displaying images from database. Hi David Thanks for a prompt response. But I also want to display other things on the jsp page besides the image. For e.g. My jsp page would have

Re: Displaying images from database.

2006-07-25 Thread vijay venkataraman
Say if all request for images will refer to the same action like image.do, then So map this to a particular action. Set the content type and write the image content to the ServletOutputStream return null for ActionForward. The snippet below should give you an idea. Consider if resource.getResour

RE: Displaying images from database.

2006-07-25 Thread prerna.sawhney
and save the changes made How can I achieve this? Thanks & Regards Prerna -Original Message- From: David Soler [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 25, 2006 6:43 PM To: Struts Users Mailing List Subject: RE: Displaying images from database. Try the following: /*** JSP

RE: Displaying images from database.

2006-07-25 Thread David Soler
Try the following: /*** JSP file / <%@ taglib uri="/tags/struts-html" prefix="html" %> <% HashMap params = new HashMap(); params.put("ID", request.getParameter("ID")); pageContext.setAttribute("params", params); %> /*** Action class */ import javax.servl

Re: Displaying Images from database using Struts tags

2006-01-24 Thread Dave Newton
Gary Feidt wrote: > Your example is using Struts 1.2.6. Maybe I can upgrade, but I don't > think so right now. I guess I was thinking of it in the wrong way as > you stated, but I sure did not think it would be difficult to display an > image stored in a database on a web page. > It's not. It

Re: Displaying Images from database using Struts tags

2006-01-24 Thread Frank W. Zammetti
You don't really need to upgrade to 1.2.6, all you need to do is take the DownloadAction class (and the ResourceStreamInfo class IIRC) from 1.2.6 and use it. There's nothing that I recall that would make it not work in previos versions of Struts. I have an app that downloads images from a databas

RE: Displaying Images from database using Struts tags

2006-01-24 Thread Braun, James F
At the risk of getting murdered again for too many comments I'll offer this recipe J. How to read an image from a db and display in an html page Goal: Display an image that is stored in a database blob in a .jsp page Synopsis: The blob is read into a byte array that is stored in the ActionForm.

Re: Displaying Images from database using Struts tags

2006-01-24 Thread Gary Feidt
Your example is using Struts 1.2.6. Maybe I can upgrade, but I don't think so right now. I guess I was thinking of it in the wrong way as you stated, but I sure did not think it would be difficult to display an image stored in a database on a web page. If anyone else has a work around that they

Re: Displaying Images from database using Struts tags

2006-01-24 Thread Dave Newton
Gary Feidt wrote: > Will the tag display a java.io.InputStream, or is there a > better way? > Not that I know of, unless the tag API doc at http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#img is wrong. You can, however, use an action or a servlet to deliver the image data.

Re: Displaying Images from database using Struts tags

2006-01-24 Thread Niall Pemberton
I think you're thinking about this the wrong way round. Tags run on the server to generate HTML content - so all the tag does is render the html markup of - its then the browsers job to download the image referenced in the "src" attribute. So what you need is to specify a url in that src attribu

Re: Displaying Images from database using Struts tags

2006-01-24 Thread Hubert Rabago
You'd have to write an Action which reads the image from the DB and writes it onto the servlet's output stream. There was a thread just yesterday which discussed how to do this. You can set your image URL to that action and provide it with enough parameters to find your image in the DB. Hubert