This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
on the servlet 3.0 specs at page no. 17 it says that complete method can throw IllegalStateException as is clear from the paragraph copied from the specs :
public void complete() - If request.startAsync is called then this
method MUST be called to complete the async processing and commit and
close the response. The complete method can be invoked by the container if
the request is dispatched to a servlet that does not support async processing, or
the target servlet called by AsyncContext.dispatch does not do a
subsequent call to startAsync. In this case, it is the container's responsibility
to call complete() as soon as that servlet's service method is exited. An
IllegalStateException MUST be thrown if startAsync was not called
if you look at the api-docs of complete() method , there is no clause regarding IllegalStateException . secondly the above paragraph is not clear. it says that if the servlet to which the request is DISPATCHED does not do startAsync then the container must call complete(). immediately in the next line ,it says that IllegalStateException must be thrown if startAsync is not called.
again i have downloaded the servlet 3.0 specs that says maintainence release rev a , december 2010. also i have final release of the specs whose date is december 2009. in crosschecked both the versions. am i reading the wrong version of specs or there is more updated spec(maybe errata). or am i totally misunderstanding the specs and the api docs. please help as i have already posted 3-4 questions back to back.