Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Originally posted by Gennady Shapiro:
Here's the thing. forward() is no different from include(), in fact it's a flavor of include() with one defining characteristic -- it throws an exception if called after output has been committed (and does so by choice, not necessity).
So, code like
is perffectly legal as long doas "as_some_calc" commits no output.
Scott<br />-----------------<br />SCJP, SCJD, SCWCD<br />XML, UML, WLS6.0
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Language, pleaseOriginally posted by Gennady Shapiro:
And to finalize this all : forward() is the same god damned include() only superficially throws IllegalStateException if prior output has been commited.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Well, just close it, of course. The response would consist of a response header (with at least an HTTP response code) and no body. There's no ambiguity there.Originally posted by Gennady Shapiro:
Ok. Can you explain to me how the container enforces Before the forward method of the RequestDispatcher interface returns, the
response content must be sent and committed, and closed by the servlet container. if there was no output??
That's all well and good, but if they do then they seem to do so in violation of the specification. I would appreciate it if you would point out where I am misreading it.I tested this code on Tomcat 3.2, 4.0 and Weblogic 6.1, the code works lovely as it should.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|