Question: I'm writing a web page using java servlets. When the user subscribes he will receive an email with the activation link. Currently the servlet redirects the user (using the request dispatcher) to the thank you page after it sends the email and this takes some time. I would like to redirect the user to the page before the email is created and sent and then have the email creation performed by another servlet without the user having to wait. Is this possible? How can I call a servlet from within another servlet after using the request dispatcher.forward method? Is that possible? If not, then what is the best way to do what I want? Thanks.

Answer: 
To call another servlet from a servlet, you donot use `request.getRequestDispatcher("xxx").forward(req,res);` but rather you use `response.sendRedirect("servletname or path to the servlet");`

You can also add parameters to the `response.SendRedirect("xxx");` so that the recieving would use that parameters to sent the email.
To add parameters to the response.sendRedirect
`response.sendRedirect("<servletname>?email="+email);` this will expose the user's email address with the new url.

Based on your question, you can do something like this:
`request.getRequestDispatcher("page/to/display/user").forward(req,res);
 session.setAttribute("email","username of user");
 response.sendRedirect("servlet/to/redirect");`

EDIT:
You can create a method with boolean which will redirect the user to the thank you page, when successful, then process the email: 

`public boolean redirect(HttpServlet request, HttpServlet){
 response.sendRedirect("<servletname>");
return true;
 }`

In the Servlet:

`if(redirect){
 processEmail(parameters);
}`
END EDIT

Then in the servlet that you want to send the email, you use the `session` to get the email that was added to the response.
`String email = (String) session.getAttribute("email");`

Hope this helps.
Based on your description you would like to return message to the user and then process 'in the background' email request. It shouldn't be done via other servlet. If you have Java EE server with JMS support, that is typical task for JMS and MDB. Your servlet would just put the message email sending request to the queue and returning message to the user. MDB would pick up that message and process it, and send the email.

Method with spawning is doable as you tested and should work in most of servers, however it is discouraged. See some discussion here [Why spawning threads in Java EE container is discouraged?](https://stackoverflow.com/q/533783/3701228) 

In Java EE 7 you will have support for it via concurrency utilities - [Concurrency Utilities tutorial](http://docs.oracle.com/javaee/7/tutorial/doc/concurrency-utilities002.htm#CIHFBCFH)