aspose file tools*
The moose likes JSP and the fly likes Cache Control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Cache Control" Watch "Cache Control" New topic
Author

Cache Control

Bunty Paul
Greenhorn

Joined: Jun 26, 2006
Posts: 28
HI,

I have few jsp pages and in order control the cache i set the header info to "no-cache". It's working fine but my problem now is i am repeating this "header" in every jsp page.

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


IS there any solution so that it is specified globally or can i specify it in web.xml.

Server used : jboss 4.0.3SP1
Browser : IE 6.0

Thanks,
Paul
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No but you could create either a custom tag or an include that will reduce the code to one line per page.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You could do this with a filter too.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cache Control
 
Similar Threads
clear cache servlet
Making a page expire
Cache Problem in Browser -Firefox
How to control Caching in JBoss
javascript