@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
// The only place that should be calling this servlet is the report chart, generated by a Freemarker
// template. The ReportChartCreator that controlled the generation put the generated image content into the
// user object, so all i need to do is write that content to the response object.
User user = Common.getUser(request);
if (user != null) {
@SuppressWarnings("unchecked")
Map<String, byte[]> imageData = (Map<String, byte[]>) user.getAttribute(IMAGE_DATA_KEY);
if (imageData != null) {
String path = request.getPathInfo();
// Path will be of the format "/<chartName>", so we need to ignore the first character.
byte[] data = imageData.get(path.substring(1));