wood burning stoves
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes sendRedirect() javadoc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "sendRedirect() javadoc" Watch "sendRedirect() javadoc" New topic

sendRedirect() javadoc

vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
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?

SCJP 1.4, SCWCD 1.5
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Vani. Yes. If flush() is called the response is commited(closes the underlying stream).
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
thanks chinmaya for clarifying. i got a doubt by reading that "written to".
I agree. Here's the link: http://aspose.com/file-tools
subject: sendRedirect() javadoc
It's not a secret anymore!