• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why status code cannot be changed during session?

 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beginner question:
Originally posted in
[url = http://www.wrox.com/books/1861007701.htm ] Professional SCWCD Sample Chapter, p.89
[/url]
" The isCommitted() method can be used to find out if any output has been returned to the client. If this method returns true then it is too late to set the status and any attempt to do so is ignored"

Does it mean that status cannot be changed during session and then resend? Why?
 
Dan Jepp
Author
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If the isCommitted() method returns true then the buffer has ben filled and the response has been committed to the client(ie they have the output in their browser!)
Changing the status code would be meaningless at this stage hence the error.
Cheers
Dan
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic