In continuation to my above post
I tried to flush my buffer before forwarding my request to a jsp..
Quite strange but am still not getting Illegal State Exception.
{PrintWriter pw = objResponse.getWriter();
pw.println("<html>");
pw.println("<head>");
pw.println("</head>");
pw.println("<body>");
pw.println("<h3>hi</h3>");
objRequest.setAttribute("Name",new String("Pratibha"));
String name = (String)objRequest.getAttribute("Name");
pw.println(name);
objResponse.flushBuffer(); String strNextScreen = "/include.jsp";
getServletConfig().getServletContext().getRequestDispatcher(strNextScreen).forward(objRequest, objResponse);
pw.println(" --");
pw.println("</body>");
pw.println("</html>");
}
also what does commit means in follwing statements
forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.