• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Caching problem in jsps

 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a problem with the caching of the jsp .I am using struts in my application and I have 5 tabs at the top of my page .When I click a tab I will change the image source by using a variable from the attribute .but the problem is often when I run my application on another client browser and I click the tab �.the variable is set properly but the image in my jsp is not changing ��..

The piece of code in my jsp to change the image of the selected tab looks like



logic:equal name="TAB" value="HOME%"
% Sytem.out.println(�Tab not highlighted�); %

a href="#"
img border="0" src='top_f_btn_home_a.gif' width="65" height="32">
/logic:equal
logic:notEqual name="TAB" value="HOME"
% Sytem.out.println(�Tab highlighted�); %
a href="#"
img border="0" src='top_f_btn_home.gif' width="65" height="32" /a
/logic:notEqual


on clicking its enetering and shoing that tab is highlighted but the image is not getting changed .even I used
META HTTP-EQUIV="cache-control" CONTENT="no-store"
META HTTP-EQUIV="Pragma" CONTENT="no-cache"
META HTTP-EQUIV="Expires" CONTENT="0"

to remove the cache but its not working ��..but the strange thing is that it always works fine on the system where the application is running but wont work properly on another client

Any help in this would be thankful
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add another head tag with your meta tags (again) at the bottom of the jsp, just before the closing html tag
Example:
...
</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>

Let me know if you still experience problems.
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi marc

Thanks for the reply that hasnt worked but i used

response.setDateHeader("Expires",0);
response.setHeader("Cache-Control","no-cache, no-store, must-revalidate");


and it worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic