Hi Ram,
Your question is: We can directly pass the request object to the delegating thread without the need of startAsync() method and so request processing thread executing the servlet method will be returned back to Request processing thread pool. So, why this startAsync method to make the asynchronous operations since we can perform this kind of asynchronous operations in versions prior to Servlet 3.0?
This is a good question.
It's true that you can pass a task to an Executor or create a new thread to handle a long running operation prior to Servlet 3.0. However, there was no way you could notify the user of the outcome because it would return BEFORE the operation was complete.
Here's from Chapter 14 of my book:
The asynchronous processing feature allows you to be frugal with
container threads.
You should use this feature for long-running operations.
What this feature does is release the request processing thread while waiting
for a task to complete so that the thread can be used by another request.
Note that the asynchronous support is only suitable if you have a long
running task AND you want to notify the user of the outcome of the task. If
you only have a long running task but the user does not need to know the
processing result, then you can just submit a Runnable to an Executor and
return right away. For example, if you need to generate a report (which
takes a while) and send the report by email when it's ready, then the servlet
asynchronous processing feature is not the optimum solution. By contrast, if
you need to generate a report and show it to the user when the report is
ready, then asynchronous processing may be for you.