|
-
Applets and cacheing of files
I have produced my first applet which reads a file from a web server,
displays it on a web page and allows the user to edit/save the data back to
the server. They can then opt to reload the data from the server, which
causes the applet to re-open and re-read the data file.
Everything works fine except when we connect to the net via FreeServe. When
I connect through FreeServe, I can not reload the saved data. I know the
correct data is written back to our server (I have ftp'ed the file and
checked it) but the data that is displayed is the pre-changed data. It
appears that FreeServe is cacheing the file so, when I re-read it, I get the
copy from FreeServe, not our server. The only way to update the data is to
disconnect from FreeServe and reconnect.
The code I use to open the file and read it is:
----------------------------------------------------
csvFile = new URL(getDocumentBase(), strDataStore);
try
{
csvConnection = csvFile.openConnection();
csvConnection.setUseCaches(false);
csvConnection.setIfModifiedSince(0);
csvStream = csvConnection.getInputStream();
} <catch code omitted>
csvStrings = new InputStreamReader(csvStream);
csvRecords = new BufferedReader(csvStrings);
// *** Read the header record. If this works, read the rest of the CSV
file
getCSVheader(csvRecords);
if (oHeader != null)
loadCSVdata(csvRecords);
csvStream.close();
csvConnection = null;
csvFile = null;
----------------------------------------------------
Is there anything else I can do to stop the file being cached? I thought
this was enough.
Thanks
Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks