JSP, forward, include, dispatch rules ?

invinfo_at_rcn.com
Date: 12/28/04


Date: 28 Dec 2004 13:25:02 -0800

Can I get a clear summary of the rules involved with these ?
forward, include, RequestDispatcher rd

<jsp:include page="servlet/MyServlet" flush="false" />
rd.forward(req, res);
<jsp:forward page="NextPart.jsp" />
response.sendRedirect("NewPage.html");

What I have seen, is that this Error occurs:
'IllegalStateException: Cannot forward after response has been
committed'
When a JSP/Servlet writes to the page using a PrintWriter and then
tries to do a forward.

Maybe the following also cause problems:
response.setContentType(...)
response.setHeader(...)
TIA for your help, suggestions; Please Advise.