Mike,

Have a filter buffer what the JSP writes and convert it to a binary
stream. Perhaps have a JSP send out SVG markup while a filter converts
it to a JPEG.

I don't have a good link to point you towards, but I frequently use the
same sort of method to generate dynamic PDF when a user wants to have a
'printer-friendly' version of a JSP generated HTML document.

Cheers,

Jayson Falkner
[EMAIL PROTECTED]


Mike Duffy wrote:

> The tech tip belows show how to dynamically create an image within a
> servlet and send it to the output stream.
>
> http://developer.java.sun.com/developer/JDCTechTips/2001/tt0821_update.html
>
> In most cases developers want to send both HTML text and images when
> dynamically creating a web page.  How can this be done?
>
> "The Servlet specification requires that servlets not call both
> ServletResponse.getOutputStream() and ServletResponse.getWriter(). "
>
> So, the only way I can think of doing this (images and HTML) is to
> transform the HTML text into a byte array and use the method
> write(byte[] b) from the class OutputStream.
>
> Can anyone think of a more elegant way to do this?
>
> Also, "Because JSP pages already call getWriter(), they must not also
> call getOutputStream()."  I think this means that it is impossible to
> dynamically create images from a JSP (which was the point of the tech
> tip above).
>
> Can anyone think of a way to dynamically generate images within a
> JSP?
>
> Mike
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
> .
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to