You can use an Ajax-style solution in which you draw your page without data, using a placeholder to retrieve the data, possibly even with a loading graphic.
How the Ajax call works, when the page loads, some kind of Javascript is launched, which will launch an Ajax Tomcat request through XmlHttpRequest, which will begin the calculation. The browser will notify the browser when the tomcat request is complete. Then, some javascript will be displayed on the web page, which will accept the response and replace the placeholder. If the server returns an HTML fragment, it is as simple as executing in javascript placeholder-div.innerHtml = text-response-text.
Here's a basic Ajax tutorial and Java example that has a web interface that interacts with the internal Java Servlet server.
source
share