When a Browser requests a page , if the page contains <img
src="blah/blah/foo.gif"></img> what happens is that you actually do a
SEPARATE download for the image and when the browser has it it displays
it in the page.
i.e. it requests a second page of content type "image/gif" since you
can't have a page with multiple ContentType's you can't do what you are
trying to do but there is no reason why your JSP can't do something like
<img src="http://MyHost/binary_image.jsp"></img>
where binary_image.jsp returns a dynamically created image.(but I'd do
it with a servlet as all I want to do is return a stream and don't care
about the display logic which your JSP already handles.
Karl
Paolo Sommaruga wrote:
>
> Cool ! How to mix image with html ? i.e., how to put
> a textual "Hello World !" after the image ?
> I have tried to put after your code
>
> <%
> out.flush();
> response.setContentType("text/html");
> %>
>
> <br>
> hello world !!!
>
> but, don't works
>
> Paolo Sommaruga
>
> >
> >As a follow-on to Christian Mallwitz's example, here is a JSP that creates a
> >JPEG dynamically using the AWT and the JPEGImageEncoder. I have tested this
> >only under JSP 1.1.
> >
> >
> >
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets