response.sendRedirect() not redirecting immediately
843842Dec 8 2008 — edited Dec 11 2008Hi everyone
I have a servlet which is to connect to DB and generate a report. This report will be put to a folder. Because this job take some times, so I planned to do something like below
doPost(HttpRequest req, HttpRespond res){
request.sendRedirect(somePage.jsp);
createReport();
}
I found that above code would not redirect user to 'somePage.jsp' immediately, it will wait until the creatReport() function finished, which means user has to wait until the report generating is finished.
Does anyone know why this happened and is there solution for this? thanks.