Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request/response flushing

 
rebecca bielecki
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
timothy zimmerman
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic