Show.jsp
<%@ page contentType="text/html; charset=gb2312"%>
<%@ include file="/DataIni/DataOpen.jsp"%>
<%@ include file="/ScriptLib/Init.jsp"%>
<%
String Id;
Id=request.getParameter("Id");
oracle.sql.BLOB m_Blob;
odbcQuery="select Body from Project_Design where ID="+Id;
odbcRs=odbcStmt.executeQuery(odbcQuery);
if(odbcRs.next())
{
System.out.println(odbcQuery);
OutputStream pOut=response.getOutputStream();
response.setContentType("application/msword"); m_Blob=(oracle.sql.BLOB)odbcRs.getBlob("Body");
byte[] Buffer=m_Blob.getBytes(1,(int)m_Blob.length());
pOut.write(Buffer);
pOut.close();
pOut.flush();
response.flushBuffer();
}
else
{
System.out.println(odbcQuery);
}
odbcRs.close();
%>
<%@ include file="/DataIni/DataClose.jsp"%>
<%@ page contentType="text/html; charset=gb2312"%>
<%@ include file="/DataIni/DataOpen.jsp"%>
<%@ include file="/ScriptLib/Init.jsp"%>
<%
String Id;
Id=request.getParameter("Id");
oracle.sql.BLOB m_Blob;
odbcQuery="select Body from Project_Design where ID="+Id;
odbcRs=odbcStmt.executeQuery(odbcQuery);
if(odbcRs.next())
{
System.out.println(odbcQuery);
OutputStream pOut=response.getOutputStream();
response.setContentType("application/msword"); m_Blob=(oracle.sql.BLOB)odbcRs.getBlob("Body");
byte[] Buffer=m_Blob.getBytes(1,(int)m_Blob.length());
pOut.write(Buffer);
pOut.close();
pOut.flush();
response.flushBuffer();
}
else
{
System.out.println(odbcQuery);
}
odbcRs.close();
%>
<%@ include file="/DataIni/DataClose.jsp"%>
解决方案 »
- doubleselect传值问题
- 有没有学习Struts1的视频啊?
- web可视化开发工具,推荐
- 如何读取数据库里的数据比较好!?
- 如何在单元格里面动态添加文本框? 求助
- 【救命~~~~急急急】高手进,解决马上结贴~!分不够再加~!
- 请问谁用过LiveConnect实现过JAVASCRIPT和JAVA的交互?
- 为什么jbuilder9里面没有javax.servlet包?
- JSP网站环境配置问题?
- log4j日志测试正常,部署服务器后只有启动的时候生成一个日志文件,今后所有的日志都写到这个文件,没有按天分割
- 那位高手能给指导一下用JSP怎样做"文章动态管理系统"?
- req.getSession().setAttribute(SESSION_SEARCHRESULT,searchResul...是什么意思。
<script>
function ShowReadOnly(Id)
{
var hwnd=window.open('','','');
hwnd.document.write("<table border='0' width='100%'>");
hwnd.document.write(" <tr>");
hwnd.document.write(" <td width='100%' align='center' style='font-size:9pt'>缩略</td>");
hwnd.document.write(" </tr>");
hwnd.document.write(" <tr>");
hwnd.document.write(" <td width='100%'><iframe src='Show.jsp?Id="+Id+"' style='width:100%;height:400px;'></iframe></td>");
hwnd.document.write(" </tr>");
hwnd.document.write("</table>");
}
</script>
<a href="#" onclick="ShowReadOnly('<%=Id%>')">缩略<%=Id%></a>
把简单的事做复杂了=====>犯罪
能不能把你 include 的几个文件也贴上来呀.