"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
public static String saveChartAsPNG(JFreeChart chart, int width, int height,
ChartRenderingInfo info, HttpSession session) throws IOException;
Saves a chart to a PNG image file in the temporary directory and returns the file name used.
The file name is registered with a ChartDeleter instance that is linked to the specified session - this
means the image file name will be deleted when the session expires. The info parameter should
be, if not null, a new instance of ChartRenderingInfo - it will be populated with information
about the chart as it is drawn for the PNG file (this information could be used to create an
HTML image map, for example). Note that the temporary file name prefix can be set using
the setTempFilePrefix() method.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Bear Bibeault wrote:
What I'd do is to make the first request using jQuery Ajax and wait until the returned promise is resolved (or use the success handler) to not make the 2nd request for the image until you're sure that the first request is done and has returned its response.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
J. Kevin Robbins wrote:. That's why I started looking at deferred to see if that might offer a solution, but I've never used it so I'm not sure. Still reading.
Bear Bibeault wrote:
I'm still somewhat mystified as to why this can't be done with a single request. Why does one request have to execute to put data into the session for the next request to fetch, versus respond with the image from the first request?
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
J. Kevin Robbins wrote:It appears that the chart generator servlet (that writes to the OutputStream) has to be triggered from an img tag to control where the chart is created.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Consider Paul's rocket mass heater. |