I'd store the image to java.io.tmpdir and retrieve it with a servlet. I doing this now with my Ajax application.
On Thu, May 5, 2011 at 2:19 PM, alexis <alz...@gmail.com> wrote: > Hello all, im facing an issue, ive been testing for a while different > approaches without success. > > I have a servlet that basically does > > . creates an image > . store the image on disk > . returns an html <img> tag pointing to the stored image. > > reason why the servlet doesnt returns the image directly using a response > type image/png is the servlet is called from an ajax script, this ajax > script renders the inner text inside a div on a jsp page on the same context > that the server runs. ajax can only render html on divs, there's no way to > return binary content (the image) from the servlet to the ajax script. > > > So, i have to create the image on the servlet (done) , store the image on > the disk (done), and return the <img> tab also done. Thing is, where im able > to store the image from the servlet im not able to read it from the jsp. > > I tried with /tmp, i tried with servletcontext.getpath to store the file on > that dir, nothing seems to work. where should i store and reference those > images to be written by the servlet and read by the jsp? > > thanks in advance > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v, 121-24)