Hi all!
I have code like this
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException {
PrintWriter out = resp.getWriter();
resp.setContentType("text/html");
out.print("<HTML>");
out.print("<body>");
out.print("forwarding..................." );
out.print("</body></html>");
out.close();
RequestDispatcher disp= req.getRequestDispatcher"/servlet/include");
disp.forward(req,resp);
}
and in include.java file
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException
{
PrintWriter out = resp.getWriter();
out.print("<html><BODY>forwared.......... ");
out.print("</body></html>");
out.close();
}
it works fine!. but I know that "forward method can be called only if output not commited to the client yet otherwise IllegalStateException thrown"
So I wonder how can we call "response commited to the client ???"
if yes please give me an example about the way we do to make "response commited to the client"
thanks in advance!