J
Jan van Mansum
Hello group,
I am preparing for the SCWCD exam. I read that
RequestDispatcher.forward() throws an IllegalStateException
if it is called after anything has been committed to the output.
However, when I run the following code in my doGet:
RequestDispatcher dispatcher =
req.getRequestDispatcher("test.html");
PrintWriter out = resp.getWriter();
out.write("Output committed.");
out.flush();
dispatcher.forward(req, resp);
I get "Output committed." written to the resulting page. I am
puzzled. I am using NetBeans 5.0 to test this. Is this a bug?
Thanks in advance for any help.
Regards,
Jan van Mansum.
I am preparing for the SCWCD exam. I read that
RequestDispatcher.forward() throws an IllegalStateException
if it is called after anything has been committed to the output.
However, when I run the following code in my doGet:
RequestDispatcher dispatcher =
req.getRequestDispatcher("test.html");
PrintWriter out = resp.getWriter();
out.write("Output committed.");
out.flush();
dispatcher.forward(req, resp);
I get "Output committed." written to the resulting page. I am
puzzled. I am using NetBeans 5.0 to test this. Is this a bug?
Thanks in advance for any help.
Regards,
Jan van Mansum.