Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed
    primarykey
    data
    text
    <p>This method throws </p> <blockquote> <p>java.lang.IllegalStateException: Cannot forward after response has been committed</p> </blockquote> <p>and I am unable to spot the problem. Any help?</p> <pre><code> int noOfRows = Integer.parseInt(request.getParameter("noOfRows")); String chkboxVal = ""; // String FormatId=null; Vector vRow = new Vector(); Vector vRow1 = new Vector(); String GroupId = ""; String GroupDesc = ""; for (int i = 0; i &lt; noOfRows; i++) { if ((request.getParameter("chk_select" + i)) == null) { chkboxVal = "notticked"; } else { chkboxVal = request.getParameter("chk_select" + i); if (chkboxVal.equals("ticked")) { fwdurl = "true"; Statement st1 = con.createStatement(); GroupId = request.getParameter("GroupId" + i); GroupDesc = request.getParameter("GroupDesc" + i); ResultSet rs1 = st1 .executeQuery("select FileId,Description from cs2k_Files " + " where FileId like 'M%' and co_code = " + ccode); ResultSetMetaData rsm = rs1.getMetaData(); int cCount = rsm.getColumnCount(); while (rs1.next()) { Vector vCol1 = new Vector(); for (int j = 1; j &lt;= cCount; j++) { vCol1.addElement(rs1.getObject(j)); } vRow.addElement(vCol1); } rs1 = st1 .executeQuery("select FileId,NotAllowed from cs2kGroupSub " + " where FileId like 'M%' and GroupId = '" + GroupId + "'" + " and co_code = " + ccode); rsm = rs1.getMetaData(); cCount = rsm.getColumnCount(); while (rs1.next()) { Vector vCol2 = new Vector(); for (int j = 1; j &lt;= cCount; j++) { vCol2.addElement(rs1.getObject(j)); } vRow1.addElement(vCol2); } // throw new Exception("test"); break; } } } if (fwdurl.equals("true")) { // throw new Exception("test"); // response.sendRedirect("cs2k_GroupCopiedUpdt.jsp") ; request.setAttribute("GroupId", GroupId); request.setAttribute("GroupDesc", GroupDesc); request.setAttribute("vRow", vRow); request.setAttribute("vRow1", vRow1); getServletConfig().getServletContext().getRequestDispatcher( "/GroupCopiedUpdt.jsp").forward(request, response); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload