In HFSJ on page No. 416, They have explained that Never use flush and foward togeather.
to Explain this they gave following code with explanation:
Explaination:
========
the Container dutifully commits(sends) "Welcome to our page!" as response and sees <
jsp:forward> then it throws an
IllegalStateException.
Except nobody will see the exception! The client sees "Welcome to our page!" ... and nothing else. The forward throws an exception but it's too late for the Container to take back the response. So the client sees what was flushed, and thats it. The forward doesn't happen, the rest of the current page doesn't happen. End of story for tht page. So never do a flush-and-forward!
In above explanation i know the reaon for an exception (as it commits reponse and then try to forward the jsp), but i didn;t understand whay they are trying tp explain by telling "The forward throws an exception but it's too late for the Container to take back the response. So the client sees what was flushed, and thats it. The forward doesn't happen, the rest of the current page doesn't happen. End of story for tht page."
Can anyone please explain.
Thanks in Advance.