java.lang.IllegalStateException,跪求解决方法!

micheall micheall 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
有限的几个用户使用时,没有出现;如果用户很多,比如几十个用户,才出现的。websphere输出的日志信息是:java.lang.IllegalStateException: Cannot forward. Response already committed.
Servlet的源代码如下:
private void getItemDetail(HttpServletRequest req) throws
javax.servlet.ServletException, java.io.IOException {
BasicDB db = new BasicDB();
String applyid = req.getParameter("oid");
long acceptid=-1;
String type = req.getParameter("type");

ItemModel item = new ItemModel();
DataModel dm_detail = new DataModel();
Connection conn = db.getConnection();
ItemAdjust itemAdjust = new ItemAdjust(conn);
AcceptJobADO aj = new AcceptJobADO();

try {
if (userid != null && !"".equals(userid)) {
UserManageFactory umFactory = UserManageFactory.newInstance();
umFactory.setConnection(conn);
UserAccount uai = umFactory.getUserAccount();
UserModel um = uai.getUser(uai.getUserID(userid));
request.getSession().setAttribute(Constant.USER_LOGIN_SESSION,
um);
}
aj.setConnection(conn);
if(applyid!=null&&(!applyid.equals(""))){
acceptid = aj.getAcceptIdByApplyId(Long.parseLong(applyid));
}
conn.commit();

item = itemAdjust.getItemDetail(acceptid+"");
SupplySleepDAO sd = new SupplySleepDAO(db);
HashMap jobs = sd.getJobSupplyInfo(acceptid);
SupplyItemModel sim = sd.getItemModelByProcessId(acceptid);
req.setAttribute("jobs", jobs);
req.setAttribute("supplymodel",sim);
conn.commit();
db.release();
}
catch (Exception e) {
try {
conn.rollback();
db.release();
}
catch (Exception e1) {}
this.logger.error("查询详情出错!,原因是:" + e.getMessage());
throw new javax.servlet.ServletException("查询详情出错!,原因是:" +
e.getMessage());
}
finally {
if (db != null) {
try {
db.release();
}
catch (Exception e) {
this.logger.error("关闭数据库连接出错!");
}
}
}

req.setAttribute("item", item);
req.setAttribute("type", type);
String url = "/eosp_admin/modules/supplySleep/itemDetail.jsp";
this.callNextPage(url);
}

其中:callNextPage封装的是用 <jsp:forward >方法。
...全文
评论 14
收藏 已收藏
分享
返回顶部
micheall
Web 开发 81,108 成员 341,721 内容