aspose file tools*
The moose likes Struts and the fly likes Caching  problem in jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Caching  problem in jsps" Watch "Caching  problem in jsps" New topic
Author

Caching problem in jsps

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
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

Joined: Feb 05, 2003
Posts: 4727

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.


A good workman is known by his tools.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Caching problem in jsps