Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Async filters

I did try that, but it failed:

java.lang.IllegalStateException: s=HANDLING rs=BLOCKING os=OPEN is=READY awp=false se=false i=true al=0
        at org.eclipse.jetty.server.Request.getAsyncContext(Request.java:592)

I didn’t pursue this much further, because it seemed to be fundamentally brittle.

Also, isn’t the response fully committed when AsyncContext.complete() is called, i.e. it’s too late to set headers, such as cookies?



On Mon, Nov 11, 2019 at 4:42 PM Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Mon, Nov 11, 2019 at 5:25 PM Nils Kilden-Pedersen <nilskp@xxxxxxxxx> wrote:
>
> I can't seem to find much information on how to code async filters.
>
> Basically, how do I know when the filter chain has completed? I need to set a cookie, but only at the very end of the request.

You use Servlet's AsyncListener and implement onComplete().

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top