at the head or called servlet I have(I also call a jquery empty on the div that holds the chart between requests. at the moment it just displays the former chart). It is like it is using cache:
Bear Bibeault wrote:Open the browser tools and observe the behavior of the Network tab. What's happening?
I looked at the output but not sure what to look for. I did see the servlet in question in the list the first time I made the request but not on subsequent request unless I close the parent form and reopen it.
Bear Bibeault wrote:What makes that request?
The last posted controller code makes a request to the following jsp which makes the request to the servlet in question.
Note: It almost has to be a cache issue because if I make a change to the img src line of code(which makes the request) to include a parameter that changes between requests it works great.
First request is
Second request is
In the original case, making request without a parameter, the browser seems to say the criteria posted to servlet has not changed so just display what is already posted.
Bear Bibeault wrote:So you are saying that when the JSP is displayed, a request to the image src is not made?
You could try the old trick of adding a random number as a request parameter just to see if it is indeed a caching issue.
Is this random number generation something that I can do with JSTL?
Bear Bibeault wrote:Yup, that should do it. Does it solve the issue?
If it does, you know you've got a caching issue. You can investigate why your caching directives aren't working (or leave the work-around, which is a bit grody, but no less used for all its grodiness).
Yes it solved the issue. But I have no idea where to start looking as to why caching directives are not working.
Thanks for your help on this today.
It does not affect the <img>'s that the page pulls back.
Here's an SO post that covers some techniques for forcing image reloads in a browser session.
A no-cache that works for a page does not work for images, at least as far as a single browser session is concerned.
Hence the use of the random number thing, to fool the browser.
It only applies to <img> tags I think.
That SO link I gave does mention a header entry that can help.