users@glassfish.java.net

Re: servlet 3.0 async, gfv3

From: emiddio-verizon <emiddio_at_verizon.net>
Date: Wed, 14 Apr 2010 11:15:36 -0700

thanks for the servlet; i will study and use it.

my servlet's init() is being called for each browser request -- i guess i will file a bug; also seen with
gfv3 sample async-request-war when debug stepping thru the code.

your why not question --

servlet1 dispatches with
AsyncContext ac = request.startAsync();
...
ac.dispatch("servlet2");

servlet2 tries to get AsyncContext via
request.getAsyncContext(); -- get exception because
request.isAsyncStarted() is false;

if unable to get the AsyncContext cannot call ac.complete();

gary

  Yes, only one init per Servlet, regardless of whether the Servlet is declared to support async operations. Shing Wai has confirmed in an earlier email that this is the case.



    i have not figured how i am suppose to use AsycnContext.complete(); if i async.dispach to another servlet -- that servlet cannot
    call AsyncContext.complete();


  Why not?