a8200232
2016-09-12 09:41
采纳率: 88.2%
浏览 921
已采纳

servlet传递参数到jsp报错,请帮忙看一下


                                 sql = "select * from component_list";                           
                                 rs=stmt.executeQuery(sql);     

                                 sql1 = "select * from express_list where account_name = '"+userName+"' and status = '已请求'";
                                 rs1=stmt.executeQuery(sql1);

                                 req.setAttribute("rs_artbut",rs);    
                                 req.setAttribute("rs_artbut1",rs1);    

                                 RequestDispatcher view_rec = req.getRequestDispatcher("rec.jsp");
                                 view_rec.forward(req,resp);
                             default :
                                 out.println("error");
                                 break;

                    out.println("</table>");
                    rs.close();
                                        rs1.close();
                    stmt.close();
                    conn.close();   

浏览器打印错误为:org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: Operation not allowed after ResultSet closed

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • 最佳回答
    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题