I want to create a servlet method like below. In this method I want to perform some data download.So if request for data download comes I just do the download. If already a download is going on I want somehow the second request to wait till the first thread is done with download. Once the first thread is done with download the second thread can start automatically.
DoTheDownloadAction(){
}
How can i achieve the above requirement?
Considering you have a
DownloadHelperclass and in your Servlet you have created one instance of that class then you can do something like this :Lets imagine you have a button called as “download” with id=”download” in your jsp and you have this code in your javascript