Z
zhanghb
Unregistered / Unconfirmed
GUEST, unregistred user!
我用JSP显示本地磁盘上的图片,图片可以显示,但不能显示其他html元素了,如文字表格等,如何解决?以下是我的代码:
<%@ page autoFlush="false"
import="java.awt.*,
java.awt.image.*,
com.sun.image.codec.jpeg.*,
java.util.*,java.io.*"%>
<%
String path = "d:/hands.jpg";
ServletOutputStream outStream = response.getOutputStream();
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new FileInputStream(path));
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(outStream);
encoder.encode(decoder.decodeAsBufferedImage());
outStream.flush();
outStream.close();
%>
<table width="100%"
border=0 bordercolorlight="#FF0000"
bordercolordark="#000080">
<tr>
<td align="center"
> 这里显示文字 </td>
<tr>
</table>
表格不能显示,想破了头也不知怎么回事,如何解决呢?
<%@ page autoFlush="false"
import="java.awt.*,
java.awt.image.*,
com.sun.image.codec.jpeg.*,
java.util.*,java.io.*"%>
<%
String path = "d:/hands.jpg";
ServletOutputStream outStream = response.getOutputStream();
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new FileInputStream(path));
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(outStream);
encoder.encode(decoder.decodeAsBufferedImage());
outStream.flush();
outStream.close();
%>
<table width="100%"
border=0 bordercolorlight="#FF0000"
bordercolordark="#000080">
<tr>
<td align="center"
> 这里显示文字 </td>
<tr>
</table>
表格不能显示,想破了头也不知怎么回事,如何解决呢?