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 - Java EE Tutorial
From the course: Java EE 8 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.