Unfortunately, JSP != Servlet.
There is no way one can return binary data from a JSP page and remain within
the spec -- at least that I am aware of!
Specifically, in a servlet you can access the servlet response's output
*stream*. In JSP, the spec says that such access is not allowed and only
provides you with *writers*, no output streams.
This means that in order to return a dynamically generated JPEG, GIF, etc,
etc, in a portable way, you have to use a servlet -- not a JSP!
This is a shame since I strongly believe that JSP should be a *complete*
late-binding equivalent to servlets. Why should one suddenly have to switch
when the output is decided to be binary? [Yes, I know one has to be careful
not to let whitespace slip into the output -- but this is also an issue for
generating XML, etc, etc, from JSP.]
--
Jess Holle
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Shawn Zhu
Sent: Wednesday, April 11, 2001 6:24 PM
To: [EMAIL PROTECTED]
Subject: Re: JSP Vs Servlet
JSP = Servlet
> -----Original Message-----
> From: Ganesh MohanRao [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 3:54 PM
> To: [EMAIL PROTECTED]
> Subject: JSP Vs Servlet
>
>
> Hi All,
>
> I have a basic doubt. I would like to know in what way "Servlet" is
> advantageous over "JSP".
>
> I feel I can do everything in "JSP" that can be done in Servlet.
>
> Is there anything which can't be done by JSP and can be done
> by Servlet?
>
>
> Thank you
>
> Ganesh
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> 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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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