What is the new async feature introduced in servlet 3.1?

I am starting to read about jee 7, and one thing I am reading:

"Servlet technology only allows traditional (blocking) I / O during the processing of a request since it was created. In the Servlet 3.1 release, the new non-blocking I / O API allows servlets to read or write without any locks."

How true is this statement since Servlet 3.0 introduced AsyncContext and the asynchronous servlet?

“This means that other tasks can be performed at the same time as reading or writing, without any expectations. This, in turn, means that now you can easily perform Ajax and partial page updates without making separate servlet calls for each update."

So, what is the new feature introduced in servlet 3.1 compared to the 3.0 specifications for asynchronous servlets?

thank

+4
source share
1 answer

Excerpt from this description :

Servlet 3.0 allows asynchronous request processing, but only traditional I / O was allowed. This may limit the scalability of your application.

Servet 3.1 (JSR 340, Java EE 7), - ReadListener WriteListener . ServletInputStream.setReadListener ServletOutputStream.setWriteListener. , , .

, , Servlet 3.1 -.

+5

Source: https://habr.com/ru/post/1537290/


All Articles