Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Marko Asplund
Hi, I did some more experimenting with both error handling approaches. Tomcat 7.0.54 and 8.0.9 seemed to work a bit differently: on 8.0.9 some requests timed out with "Exception while processing an asynchronous request" error message. I was unable to reproduce this on TC 7.0.54 or Resin 4.0.40. W

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Mark Thomas
On 09/07/2014 16:53, Marko Asplund wrote: > On 09/07/2014 09:16, Mark Thomas wrote: > >>> There's a couple of parts in particular that I'm wondering about: >>> - what's the correct way to deliver error response to client? Can I just >>> cast the response acquired from AsyncContext to HttpServletRe

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Marko Asplund
On Wed, 09 Jul 2014 09:59 Martin Grigorov wrote: > Casting ServletResponse to HttpServletResponse is OK most of the time. You > can check with "instanceof" before doing the cast. > But casting AsyncContext to HttpServletResponse is way too brave. Quite true, I'm not usually that courageous on pur

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Marko Asplund
On 09/07/2014 09:16, Mark Thomas wrote: > > There's a couple of parts in particular that I'm wondering about: > > - what's the correct way to deliver error response to client? Can I just > > cast the response acquired from AsyncContext to HttpServletResponse and use > > the normal Servlet API mech

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Martin Grigorov
On Wed, Jul 9, 2014 at 12:48 PM, Marko Asplund wrote: > On Wed, 09 Jul 2014 07:23 Martin Grigorov wrote: > > > > ... > > > try { > > > response = (HttpServletResponse)asyncContext; > > > > > > > Maybe it is implementation detail that this cast works but usually you > have > > to

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Marko Asplund
On Wed, 09 Jul 2014 07:23 Martin Grigorov wrote: > > ... > > try { > > response = (HttpServletResponse)asyncContext; > > > > Maybe it is implementation detail that this cast works but usually you have > to use > http://docs.oracle.com/javaee/6/api/javax/servlet/AsyncContext.html#

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Mark Thomas
On 08/07/2014 23:18, Marko Asplund wrote: > Hi, > > I'm just starting out with using the Servlet 3.1 asynchronous processing > API. > I use the API for generating response content, that can potentially be a > slow process, in another thread. > The code appears to

Re: Servlet 3.1 asynchronous processing API

2014-07-09 Thread Martin Grigorov
Hi, On Wed, Jul 9, 2014 at 1:18 AM, Marko Asplund wrote: > Hi, > > I'm just starting out with using the Servlet 3.1 asynchronous processing > API. > I use the API for generating response content, that can potentially be a > slow process, in another thread. > The code

Servlet 3.1 asynchronous processing API

2014-07-08 Thread Marko Asplund
Hi, I'm just starting out with using the Servlet 3.1 asynchronous processing API. I use the API for generating response content, that can potentially be a slow process, in another thread. The code appears to be working, but since the specification contains many caveats, I'd like to try