One way to do it (besides trying not to take too long on this kind of processes) is calling another page/servlet/jsp that will in turn call your heavy load servlet and display appropiate feedback to the user.
Here is how.
Lets asume right now you have 1 page and a servlet.
Page 1: form page (with a button to
ProcessHeavyStuffServlet (our slow servlet)
We have to change this by adding a couple of things. like this:
Page 1. Form page (user fills stuff and clicks next which is the heavy load stuff)
We replace the ProcessHeavyStuffServlet link with a link to a waiting page.
Page 2. Waiting page (new page)
Here we have a waiting image and we call the ProcessHeavyStuffServlet using AJAX or an IFRAME (i know they are ugly but sometimes useful)
ProcessHeavyStuffServlet We modify this one to store some data in the session (like the results of the execution) at the end of the execution it will tell the waiting page (using AJAX or in the IFRAME using a parent call) to go to:
page 3. Results page (new page)
We get the data that ProcessHeavyStuffServlet stored in the session and display it.
This is the theory behind those beautiful and annoying "please wait" sliders and gizmos.