Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

doubt regarding complete() method of AsyncContext interface?

Ranch Hand
Posts: 924
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic