?
Solved

Refresh the Charts Image on load of the page

Posted on 2005-04-14
14
Medium Priority
?
209 Views
Last Modified: 2010-04-01
We are creating Pie chart and Bar chart through servlet as Buffered Image and invoking through Jsp by using <img src="" >  tag.

But we are facing the problem when User in the same browser and invokes the Charts agian with different data and displays the previous chart. When I wiil refresh the page image is getting refresh.

Now I want to refresh the page on load without specifying any interval.

0
Comment
Question by:ramsharma23
  • 4
  • 4
  • 3
11 Comments
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13782729
>> different data and displays the previous chart.

Have you turned off cacheing via the html headers?
0
 
LVL 29

Accepted Solution

by:
bloodredsun earned 1000 total points
ID: 13782741
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
0
 
LVL 19

Assisted Solution

by:Kuldeepchaturvedi
Kuldeepchaturvedi earned 1000 total points
ID: 13782787
there are are two ways of doing it...
one that bloodred is suggesting.....

you accomplish it b putting following lines in your HTML code under <HEAD> tag

<META http-equiv="Content-Type" content="text/html">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Cache-Control" content="no-cache">
<META http-equiv="Expires" content="-1">

Another one is a method that Tim's fav ( mine too)...

change your IMG tag to

<img src=yoururl?t=<%= "" + System.currentTimeMillis() %>" >

It normally throws the Browser in to thinking that he is loading a diff image every time...



0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 35

Expert Comment

by:TimYates
ID: 13782882
>> Another one is a method that Tim's fav ( mine too)...

bah ;-)  too late ;-)

hee hee...

I like that one, as it even fools rubbish old caching proxy servers :-D
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13782902
And this is the full set of headers that *should* cover all versions of IE/Mozilla

<%
        // Set to expire far in the past.
        response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
        // Set standard HTTP/1.1 no-cache headers.
        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
        // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
        response.addHeader("Cache-Control", "post-check=0, pre-check=0");
        // Set standard HTTP/1.0 no-cache header.
        response.setHeader("Pragma", "no-cache");
%>
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 13782918
Yup! and thats why its my fav... the meta tags sometimes decides not to work with proxy cachings... but this method faithfully works in that case as well..:-)
and yeah  too late.......LOL..:-)
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13782981
>>bah ;-)  too late ;-)

You need some sort of automated checking application my friend. Come into my shop and don't forget your wallet , mwah hahaha!!.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13782998
hee hee!

I told you sometimes it was the other way round (me just agreeing with you) ;-)

My PC's running slow because I keep loading 2Gb of spanned CAB files (and it's fighting with my RAM and hard-disk)...

That's my only excuse! ;-)

I need a holiday....

;-)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 14606532
Split between  bloodredsun and Kuldeepchaturvedi

I reckon...
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 15344004
Agreed
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 15347950
I am okay with it
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question