I'm not sure if I understood the problem you've encountered correctly, but hope it helps,
you can use img tag (or if ur using struts, html:img) and point the url of a servlet (or action if using struts) to a servlet (or action), load the image in servlet (action) and write it in the ServletOutputStream. The only thing you have to consider is that you should set the output of the servlet to image.
If this is what you want to do, I can send you the code (pure servlet or struts). Just let me know...