SCJP 1.4, SCWCD 1.4
SCJP 1.4, SCWCD 1.4
So it is doing almost what I said: i.e. when modifying the headers it does nothing - they must have fixed that bug in your version of Tomcat, where IllegalStateException used to be thrown (this isn't logged either which is still compliant behaviour). On the point of the output content not being written, this does in fact agree with the specs which state "Before the forward method of the RequestDispatcher interface returns, the response content must be sent and committed, and closed by the servlet container". Hence the entire response is committed and closed so no more content sent to the buffer will go to the client - though it won't cause an exception either! I had to check that with the offical spec as it just isn't sensible to write anything after the forward, and certainly I never do... The exam will almost certainly never ask that sort of question.I just tried the following code in NetBeans 5.5.1 with bundled Tomcat 5.5.17... In the page only appears "In forwarded-to servlet" and in the log appears no IllegalStateException after the message "Provoking IllegalStateException here?"
Run away! Run away! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|