File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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:
subject: sendRedirect() javadoc
jQuery in Action, 3rd edition