This question is probably more suited to another mailing list ... but I want to win the Java Cookbook! Can anyone explain the most likely cause of the http error message: "ERROR: Cannot forward. The response has already been committed". I know that it means that the headers have already been written - but what does this mean and how can I avoid it?
This is probably a better question for the Servlet/JSP forum. You don't mention if you are getting this error from a Servlet or JSP? There may be a few causes for this but one cause may be that you are trying to do a forward after getWriter()? [This message has been edited by timothy zimmerman (edited September 28, 2001).]
True, you're in the wrong forum (but I want one too ) You should be careful to never write anything to the response until you are sure that is what you want to display. Model-View-Controller (or Model 2 Architecture) is a great way to reduce these problems. Essentially a servlet is the controller, it decides which JSP (view) gets to display the data but is not allowed to display data itself. Since the controller doesn't write any data it is free to forward whenever it wants... Dave.