There are two servlets and one
jsp. The first servlet includes the second. The second servlet does some processing. The first servlet then forwards to the jsp. The forward is not working because the second servlet has automatically obtained a PrintWriter. I am getting an
IllegalStateException. I have narrowed it down to the included second servlet. I have tested the second servlet by itself with an empty service method. It still produces output e.g. headers and some basic html. This output is what is getting in the way of the forward call. I am including and forwarding using the following code:
RequestDispatcher d = getServletContext().getRequestDispatcher("/filename");
d.include(request, response);
or
d.forward(request, response);
Any help will be greatly appreciated.
Warren Bell