From the course: Java EE 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Asynchronous support

Asynchronous support - Java EE Tutorial

From the course: Java EE 8 Essential Training

Start my 1-month free trial

Asynchronous support

- [Instructor] Servlets can be expensive when events such as remote web service calls or database writes are required. When these operations occur frequently, the server can experience a poor quality of operations due to thread starvation. Threads are valuable resources for web containers so it's important to use them efficiently. Asynchronous servlet support was introduced in Java EE 7 to help us eliminate these problems. Let's take a quick look at how to use asynchronous support within servlets. So the first thing we'll need to do is modify our web servlet annotation in order to contain the support for async, so to do that you'll see the async supported element on the annotation. Just set that to true and when we do that, we'll have to specify the URL patterns element on that web servlet annotation as well and in order for this to work we'll have to do the same thing on our filter. So we'll set async supported to true…

Contents