且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

没有使用servlet从Oracle表中显示图像

更新时间:2022-12-06 07:38:15

使用调试器或代码跟踪来查看其执行的内容.

Use a debugger, or traces in the code, to see what it executes.

使用Firebug查看响应中包含的内容.

Use Firebug to see what the response contains.

并修复从blob到输出流的读取和写入:InputStream.read()不必一次读取所有字节.它返回实际读取的字节数.您应该循环执行,直到此方法返回-1表示已读取所有内容.阅读 Java IO教程.

And fix the reading and writing from the blob to the output stream: InputStream.read() doesn't necessarily read all the bytes at once. It returns the number of bytes that were actually read. You should loop until this method returns -1 to indicate that everything has been read. Read the Java IO tutorial.