I found some code on SO that does what I want, but I don't understand how it works. Background: I have an iframe which will display a chart (JFreeChart) generated by a
servlet. The user enters a date range which goes to another servlet which gets the dataset and puts it in the session. The chart generator grabs that dataset and creates the chart. I needed to refresh the iframe so it would build a new chart when the parameters are entered or new parameters are entered.
This may not be the best way to do things, but after two days of struggling with JFreeChart, this is what I came up with, based on the examples in their developer guide.
The first solution suggested was this:
In other words, setting the src attribute to itself to force a refresh. This didn't work for me. This does work:
But I don't understand how it works. If I leave out the "i" parameter, it doesn't work. So what is "i" and where does "val" get a value from?