Use send redirect before doGet finish
I have a servlet that emails a report to the user when they fill in the form. Then the servlet redirects to another page. I try to send the redirect page first and let the process continue as shown in the code:
public void doGet(HttpServletRequest request, HttpServletResponse response) {
response.sendRedirect(response.encodeRedirectURL(揳nother_page?;
processAndsendEmail(); //takes 10 seconds
}
However the server (Tomcat) seems to send the redirect page after the doGet method is done. The user can not see the another_page until the process is finished.
Any idea to make this work?
Thanks.

