<div id="mailContentContainer" class="qmbox" style="height: auto; min-height: 100px; _height: 100px; word-wrap: break-word; font-size: 14px; padding: 0; font-family: 'lucida Grande', Verdana;">
<%=response.getOutputStream() %>
</div>
在我写的jsp页面里有这样一段这样的代码。这段代码的主要内容是把response.getOutputStream() 输出的内容插入在jsp页面中布置的位置上。但是我这样写的话,显示的内容会把整个jsp页面给覆盖掉。求求诸位大神叫我一个解决的办法。
<%=response.getOutputStream() %>
</div>
在我写的jsp页面里有这样一段这样的代码。这段代码的主要内容是把response.getOutputStream() 输出的内容插入在jsp页面中布置的位置上。但是我这样写的话,显示的内容会把整个jsp页面给覆盖掉。求求诸位大神叫我一个解决的办法。
比如:
OutputStream out = response.getOutputStream();
while ((len = br.read(buf)) > 0) {
out.write(buf, 0, len);
}
br.close();
out.flush();
out.close();
<%
out.clear();
out = pageContext.pushBody();
%>
<meta http-equiv="Content-Type" content="text/html;charset=GB18030">
<%
Folder folder = (Folder) session.getAttribute("folder");
String string = request.getParameter("msgnum");
string = string.trim();
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
System.out.println(string);
int msgnum = Integer.parseInt(string);
response.reset();
try { Message message = folder.getMessage(msgnum);
if (!message.isMimeType("multipart/mixed")) {
// 若邮件类型不是"mixed"则表明不包含附件,
// 并设置类型让浏览器直接输出正文
response.setContentType("message/rfc822");
message.writeTo(response.getOutputStream());
out.clear();
out = pageContext.pushBody();
} else {
// 如果是"mixed"型,则遍历所有BodyPart对象,
// 把不包含附件的邮件正d文打印出来。
// 这是为了不让该程序既输出正文又传输附件大量的数据
Multipart multipart = (Multipart) message.getContent();
int bodyCounts = multipart.getCount();
for (int i = 0; i < bodyCounts; i++) {
BodyPart bodypart = multipart.getBodyPart(i);
// 不是"mixed"型且不包含附件
if (!bodypart.isMimeType("multipart/mixed")
&& bodypart.getDisposition() == null) {
response.setContentType("message/rfc822");
bodypart.writeTo(response.getOutputStream());
out.clear();
out = pageContext.pushBody();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
%>
在这个地方该如何调用 上面的那个输出流来显示在下面的mailContentContainer这个地方。<div id="mailContentContainer" class="qmbox"
style="height: auto; min-height: 100px; _height: 100px; word-wrap: break-word; font-size: 14px; padding: 0; font-family: 'lucida Grande', Verdana;">
<!-- -->
<style>
#mailContentContainer .txt {
height: auto;
}
</style>
</div>