the browser does not receive a notification when the download completes., nor can a request return two responses. a common solution is for javascript to poll the server for completion. the download should have a unique id. the download needs to keep the download status for the request in a persistent store (static memory can be used if single server).
note: the download handler can not use session, or it will block the polling call.