| Author |
what commits the response ?
|
Niranjan Deshpande
Ranch Hand
Joined: Oct 16, 2005
Posts: 1277
|
|
hfsj says, flush( ) commits the response. so we cant call anything on the response ( methods to do sendRedirect( ) and adding/setting things in the response ), once we say flush( ). my query is if, after the response is commited, and i say out.println( ), where out is a PrintWriter, what will happen ?
|
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
If the response is commited you cant forward to any other servlet. You have to choose. Either commit the response and handle the content yourself or forward to another servlet/JSP without commiting the response
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
It will give you an IllegalStateException as it is given in the specs.
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Niranjan Deshpande
Ranch Hand
Joined: Oct 16, 2005
Posts: 1277
|
|
|
thanks
|
 |
 |
|
|
subject: what commits the response ?
|
|
|