• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

doubt regarding complete() method of AsyncContext interface?

Ranch Hand
Posts: 924
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic