File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Is it possible to clear history/ temp files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is it possible to clear history/ temp files " Watch "Is it possible to clear history/ temp files " New topic
Author

Is it possible to clear history/ temp files

Anil Verghese
Ranch Hand

Joined: Oct 11, 2006
Posts: 155
Hi,

Is it possible to clear the temporary files and the history/cookies , if yes how
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No, not from the server.
The best you can do is suggest that the browser not cache your pages.
See: http://faq.javaranch.com/java/NoCacheHeaders

As for cookies.
See the API to see how to set the expiration date and to add/remove values:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/Cookie.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Not really, but when you send resources to the client, you can provide cache control settings in the header encouraging them to cache or not cache that resource.

This is not the same as clearing their cache, since you need to tell the client your cache settings at the time you send the resource, not some time afterwards.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Is it possible to clear history/ temp files