Two options:
1) Follow chanoch's advice. In the HTML page, put it in a IMG tag with the SRC set to the servlet. The servlet can then dynamically generate the pie-chart (or stream a cached version stored in a file or an image buffer) and write it to the servlet's output stream.
2) Have a servlet (or JSP file) handle the original page request. The servlet/JSP should generate the pie-chart and write it to a file in the web app's
doc tree. It should then generate the HTML containing a reference to the generated image.
psuedo-code:
String relativeImageUrl = generateUniqueUrl();
createPieChart(relativeImageUrl, ...);
...
out.println("<IMG SRC=\"" + relativeImageUrl + "\" ...>");
...
One disadvantage of approach 2: You introduce the maintainance issue of cleaning up the generated images.