Well it was a simple HelloWorldServlet which creates an asyncContext, get a
writer from response and prints "Hello World".

it was something like:

public void doGet(HttpServletRequest request, HttpServletResponse response)
 throws ...{

AsyncContext ac = request.startAsync(request, response);
ac.start(()-> {
ac.getResponse().getWriter().println("Hello World");
});
}

Hope this helps but it was as simple as this.

I was using Tomee 1.7 and Java 8



2014-07-25 18:03 GMT+02:00 Vamsee Lakamsani <[email protected]>:

> Hi Alex, are you able to share that demo via some git repo?
>
>
> ________________________________
>  From: Alex Soto <[email protected]>
> To: "[email protected]" <[email protected]>
> Sent: Thursday, July 24, 2014 11:21 PM
> Subject: Re: non blocking i/o and async servlets (servlet 3.1)
>
>
> Yes I tried yesterday in a demo and it worked. You won't have jax-rs async
> support since Apache cxf3 is integrated but for Servlet no problem at all.
>
>
>
>
>
> 2014-07-25 7:37 GMT+02:00 Romain Manni-Bucau <[email protected]>:
>
> > Depend which parts but async context is in ee 6 and already helps a lot
> > regarding it.
> >  Le 25 juil. 2014 06:26, "Vamsee Lakamsani" <[email protected]> a
> > écrit :
> >
> > > http://docs.oracle.com/javaee/7/tutorial/doc/servlets013.htm
> > >
> > >
> > > Is it possible to do the above by adding "some" EE 7 jars to TomEE 1.6
> or
> > > 1.7 or is it only possible when TomEE 2.0 arrives later this year with
> > > Tomcat8 in it?
> > >
> >
>
>
>
> --
> +----------------------------------------------------------+
>   Alex Soto Bueno - Computer Engineer
>   www.lordofthejars.com
>
> +----------------------------------------------------------+




-- 
+----------------------------------------------------------+
  Alex Soto Bueno - Computer Engineer
  www.lordofthejars.com
+----------------------------------------------------------+

Reply via email to