This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
yes, you can do it, but remember... when you forward the request you�re saying that you aren�t responsible to the result of response, in this case, assuming you don�t called the out.flush(), the container will clear all buffered data in out object before it forward the request.
If happen something bad in you life, don't ask God why it happened. Ask for what.
SCJP 5 (80%) - SCWCD 5 (91%) - SCBCD & SCJD coming soon...
Its guaranteed that if you flush the buffer and then do a forward you will get a IllegalStateException. out.flush(); <jsp:forward page="x.jsp"/>
However if you do out.write("x"); <jsp:forward page="x.jsp"/> Then you might not get exception because here all the data will be stored in the buffer and will not be flushed unless it fills up. Default buffer size is 8kb and autoFlush attribute of page directlive is true. Hence if you have 8kb of data before jsp:forward then container will flush it automatically and hence there is a possiblity that you can get exception out.write("x"); <jsp:forward page="x.jsp"/>