• Post Reply Bookmark Topic Watch Topic
  • New Topic

sendRedirect() javadoc

 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
can some one explain meaning of
If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
it is given in javadoc of sendRedirect method.
does that mean, we should not call flush() on response once we call sendRedirect? or we should not even try to write into response?
 
Chinmaya Chowdary
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Vani. Yes. If flush() is called the response is commited(closes the underlying stream).
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks chinmaya for clarifying. i got a doubt by reading that "written to".
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!