简单查询输出报错,清大侠看看,全部48分送上,惨…… 出现 IllegalStateException 可能的原因是你的页面已经转到其它地方去了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 完整代码:view_attachment.jsp //是对TRS数据库操作,不过都无所谓//////////////////////////////////////////////////////就是最后几行出错getOutputStream() has already been called 这个错误大侠们应该很清楚吧//////////////////////////////////////////////////////<%@ page import="com.eprobiti.trs.*,java.io.*,java.sql.*" contentType="text/html;charset=GBK"%><jsp:useBean id="trscon" scope="session" class="com.eprobiti.trs.TRSConnection"/><% long lRecNo; int iColNo = 6; int iIndex; String strParam; strParam = request.getParameter("id"); lRecNo = Long.parseLong(strParam);// strParam = "1";//request.getParameter("multino"); iIndex = Integer.parseInt(strParam); com.eprobiti.trs.TRSResultSet trsrs2 ;String strIP = "172.21.10.33";String strPort = "8888";String strUser = "system";String strPass = "manager";boolean trsIsConnect=false; try { if (trscon.isClosed()) { trscon = new com.eprobiti.trs.TRSConnection(); trscon.connect(strIP, strPort, strUser, strPass); session.setAttribute("trscon", trscon); } trsIsConnect = true; } catch(Exception ex) { ex.printStackTrace(); }trsrs2= new com.eprobiti.trs.TRSResultSet(); trsrs2.setConnection(trscon);String strWhere = "";//"file_id="+request.getParameter("file_id"); if(trsrs2.isClosed()) { trsrs2.executeSelect("cieccinfo", strWhere, "", "", "", 0, com.eprobiti.trs.TRSConstant.TCE_OFFSET, false); trsrs2.setReadOptions(com.eprobiti.trs.TRSConstant.TCE_OFFSET,"",";"); } try { trsrs2.moveTo( 0,iIndex ); byte[] photo = trsrs2.getBytes(iColNo, 0 ); javax.servlet.ServletOutputStream outx = response.getOutputStream(); outx.write(photo,0,photo.length); photo=null; } catch(TRSException ex) { ex.printStackTrace(); }%> 一般getOutputStream() has already been called是什么引起的呢 Calling flush() on the PrintWriter commits the response. 调用flush()后程序运行 没问题了,但是log文件中 还是报错,而且会导致系统崩溃,???????????????????????????? 帮我看看这段代码哪里出问题了(简单问题,求解决啊) jdbc的 连接? Java小问题一个 帮忙解释一下 java线程,大家把结果写出来...并且说出原因 共享一道面试题 Object 转到原来未知的类型 [求助]??在JtoolBar上不能增加图片?? ***求包:import javax.servlet.*;*** 请教一个线程应用的问题? 使用JDBCODBCDRIVER连SQL SERVER 7的问题 提问兼散专家分:请问DefaultCellEditor类如何使用? 为什么类Search中的Search1不能引用类FindLarge中的Find
view_attachment.jsp //是对TRS数据库操作,不过都无所谓
//////////////////////////////////////////////////////
就是最后几行出错
getOutputStream() has already been called 这个错误大侠们应该很清楚吧
//////////////////////////////////////////////////////
<%@ page import="com.eprobiti.trs.*,java.io.*,java.sql.*" contentType="text/html;charset=GBK"%><jsp:useBean id="trscon" scope="session" class="com.eprobiti.trs.TRSConnection"/><%
long lRecNo;
int iColNo = 6;
int iIndex;
String strParam;
strParam = request.getParameter("id");
lRecNo = Long.parseLong(strParam);
// strParam = "1";//request.getParameter("multino");
iIndex = Integer.parseInt(strParam);
com.eprobiti.trs.TRSResultSet trsrs2 ;String strIP = "172.21.10.33";
String strPort = "8888";
String strUser = "system";
String strPass = "manager";
boolean trsIsConnect=false;
try
{
if (trscon.isClosed())
{
trscon = new com.eprobiti.trs.TRSConnection();
trscon.connect(strIP, strPort, strUser, strPass);
session.setAttribute("trscon", trscon);
}
trsIsConnect = true;
}
catch(Exception ex)
{
ex.printStackTrace();
}trsrs2= new com.eprobiti.trs.TRSResultSet();
trsrs2.setConnection(trscon);
String strWhere = "";//"file_id="+request.getParameter("file_id");
if(trsrs2.isClosed())
{
trsrs2.executeSelect("cieccinfo", strWhere, "", "", "", 0, com.eprobiti.trs.TRSConstant.TCE_OFFSET, false);
trsrs2.setReadOptions(com.eprobiti.trs.TRSConstant.TCE_OFFSET,"",";");
}
try
{
trsrs2.moveTo( 0,iIndex );
byte[] photo = trsrs2.getBytes(iColNo, 0 );
javax.servlet.ServletOutputStream outx = response.getOutputStream();
outx.write(photo,0,photo.length);
photo=null;
}
catch(TRSException ex)
{
ex.printStackTrace();
}
%>