Of course you could try something like ....
<%@page contentType="image/gif"
%><%@page import="java.io.BufferedInputStream,
java.io.ObjectOutputStream,java.io.OutputStream,java.io.File "
%><%
OutputStream f = response.getOutputStream();
File logo= new File("tester.gif");
BufferedInputStream bis = new BufferedInputStream (new
FileInputStream(logo));
int a=0;
while ( (a=bis.read()) != -1 )
{
f.write(a);
}
bis.close();
%>
obviously this is from a file but essentially it's the same thing.
Just get an input stream from your blob and bingo !
I would suggest that you re-consider serving graphics from a blob.
Many reasons but primarily
- it will knacker your database - performance
- databases wern't designed to store files - filing systems were
But other than that hey have fun !
Hope this works for you
David
David Wall wrote:
> > Is there a way to display images from database blob fields within only
> jsp,
> > i know that it is impossible because of you can not handle an another
> > outputstream
> > within jsp.
>
> Your JSP needs to output an IMG tag with a 'src' that points back to your
> application as another GET that will then return the image of interest.,
> generally from a simple servlet that sets the content-type to image/gif or
> whatever the image format is.
>
> David
>
> --
> To unsubscribe: <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>