tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Punte" <>
Subject Was OutputStream: Now Where JSP and Servlets differ
Date Fri, 28 Apr 2000 16:20:32 GMT

> Steven Punte wrote:
> > 
> > In order to output a binary image from a JSP file,
> > I'm using method calls on the ServletOutputStream
> > object obtained from response.getOutputStream().
> >   .....
> I can't imagine the circumstances in which you would want
> a JSP to serve a binary file. Any <img tag in the page
> is going to create a separate request anyway, why not 
> directly address a servlet?

    For this particular small project, I desired to implement
everything as JSP pages.  This was a tactical decision for
the purpose of simplicity (i.e. follow one paradigm).  There
was "some" duplication of code, but not much.   Overall,
I was pretty happy with the decision.   The only part I'm
having trouble with is the serving up of a binary image
retrieved from a database.  I used the example out of the
Oreilly Servlet book.   It work great, except for this
stream closure problem.  Another post has explained 
the paradigm problem, and that I should attempt this
in a servlet only.

    Funny, until now, I was thinking a JSP files seemed to
do just about everything a servlet could do.

STeve Punte
e-Business Software Architect
Technologent Inc

View raw message