This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

refresh problem  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a List Student page and a update page, everytime I updated, I use response.sendRedirect("ListStudent.jsp") back to the List Student page, but I have to click refresh button, then the record on the page changed, what I should do to make it automatic refresh? Thanks
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try using request.forward(<url> instead of response.sendRedirect..
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Alternate soln could be
U could also use the meta tag of ur where the page is refreshed every n secs.
http-equiv="refresh" content="60" in the meta tag.
Rgds,
Seetesh
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to force the page to refresh, what you need is to prevent it from being cached in the first place. That's been discussed more times than I can count, so please do a search for this issue.
 
feng fu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry, but "request.forward<url>" doesn't work. It gives me a tomcat error. And I used <meta> before, it only refresh every one miniute. I think that is not what I want, I want it just refresh when List Student page is re-opening
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please re-read my reply. You do NOT need a refresh. The browser is pulling up your old page from the cache. What you need to do is to prevent the page from caching.
 
feng fu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found these code about prevent reload the page from cache
"response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma", "No-cache");
response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control", "no-cache");
" where should I put it? Could you tell me what I should do, thanks
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just put the code at the top of the JSP page:
 
feng fu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the code you give me, but it didn't change, I still need to click refresh. It that mean it is not because of the cache?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are sure that you are sending the new data to the page after the update (are you?) then if it is showing the old data, you have a cache problem. It is possible that your problem lies in code logic, but that isn't borne out by the fact that a refresh brings up the new data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!