• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:forward and refresh  RSS feed

 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I use the jsp forward tag, the destination page is not refreshed i.e it is not loaded from the server. Instead it is loaded from cache? I then have to press F5 to get the page from the server. What can I do to stop this in my jsps?
Thanks
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using no-cache META tags in the page that is being forwarded to? There is a similar jsp tag that controls caching, but this is a very old issue, and many people report various levels of success.
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Mike. I will investigate this.
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved the problem by using response.sendRedirect("pageName.jsp"). This will actually re-load the destination page from the server and then display it. The jsp forward tag does not reload the page from the server, all it does is to display it. It does not change the address in the address box.
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sendRedirect doesnt reload the page from the server.
it says to the client's browser to change to that URL.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!