Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

response.sendRedirect() not redirecting immediately

843842Dec 8 2008 — edited Dec 11 2008
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2009
Added on Dec 8 2008
3 comments
899 views