You can still have your image tag go to a servlet that would
use that bean and send back the image.  The servlet can get
the current session for this user and then get the bean out
of that request, form a header, get output stream and send
back the data.

If the bean is in session it is equally visible to servlet
and jsp (a servlet anyway).  The fact that you call the
servlet from img tag in HTML doesn't change the mechanics of
the request.  This servlet still has the same session
context as if you called it as a URL.

dave.

David Galimberti wrote:

> I am attempting to build dynamic charts (as PNG images) in
> a JSP.  I can easily do this by using a servlet as the
> source of an image tag as follows: <img
> src="/servlet/buildchart"> The problem is the data to
> build my chart will reside in an instance of a session
> bean (i.e. a bean that has scope= "session").  I can think
> of the following two approaches to handle this: 1) Access
> the bean instance that has the data from my servlet. 2)
> Have a method in the bean generate a dynamic image stream
> and include it in the JSP using something like: <img
> src="<%= mybean.getMeAChart()%>"> Does anyone know how to
> best implement either or both of these
> approaches? Thanks! - David

--
David Mossakowski              [EMAIL PROTECTED]
Programmer                           212.310.7275
Instinet Corporation

"I don't sit idly by, I'm planning a big surprise"

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to