I have the following code in a JSP page:
<c:forEach var="widget" items="${widgets}">
<p><h2>Widget</h2></p>
<p>IDType: ${widget.id}</p>
<p>Name: ${widget.name}</p>
</c:forEach>
At the moment it is only text that will be displayed, but in the future there will be charts and images as well. I would like to use asynchronous loading, so the page doesn't have to wait on the largest images/charts. On the internet I found tutorials for Java code, but not for JSP pages. What is the best way to implement asynchronous loading in JSP pages?
Thanks!
Simply generate these images and charts separately using different servlet:
On the server side map some servlets to
chart-servlet.png
andimage-servlet.png
. You can then useid
parameter to generate appropriate chart or image. From the browser perspective it first renders DOM without images to then ask server for external resources (images).