users@servlet-spec.java.net

[servlet-spec users] Re: Servlet 4.0 Spec comments

From: Greg Wilkins <gregw_at_webtide.com>
Date: Wed, 2 Dec 2015 13:24:51 +1100

On 2 December 2015 at 10:00, Martin Mulholland <mmulholl_at_us.ibm.com> wrote:

> Section 3.7:
>
> ▪ *onDataAvailable()**. The **onDataAvailable **method is
> invoked on the **ReadListener **when data is available to read from the
> incoming request stream. The container will invoke the method the first
> time when data is available to read. The container will subsequently invoke
> the **onDataAvailable **method if and only if **isReady **method on *
> *ServletInputStream**, described below, returns **true.*
>
>
> The last word in this has been changed from “false” to “true” which
> changes it from a container perspective to and app perspective.
>

Good catch!

This is just wrong! It is not a perspective thing. A container will
NEVER call onDataAvailable after the first invocation unless isReady has
been called AND it returned false.



> This should be clarified. I suggest:
>
> The container will subsequently invoke the onDataAvaialble method if and
> only if isReady method on ServletOutputStream, described below, previously
> returned false but will now return true.
>
> hmmm I think I probably prefer just reverting to false.... but if a
clarification is really needed, how about

The container will subsequently invoke the onDataAvaialble method when data
becomes available to read, if and only if isReady method on
ServletOutputStream, described below has been called and returned false.

Ditto for write listener.



-- 
Greg Wilkins <gregw@webtide.com> CTO http://webtide.com