Posted By:
Anonymous
Posted On:
Thursday, June 14, 2001 12:36 PM
I have a method for serializing a hashtable. _cache is the hashtable, and _cachefile is the name of the file to serialize to (both are global variables in a servlet class). Here is my method: ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(_cachefile)); os.writeObject(_cache); os.close(); Am I missing something? When I call this method, my hashtable is serializing, but none of the data is saved. Every single key and value in the hashtable is a String (which is serializable), but when I go to load the object, the hashtable I load is empty! Thanks for the help, ~Matt
More>>
I have a method for serializing a hashtable.
_cache
is the hashtable, and
_cachefile
is the name of the file to serialize to (both are global variables in a servlet class).
Here is my method:
ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(_cachefile));
os.writeObject(_cache);
os.close();
Am I missing something? When I call this method, my hashtable is serializing, but none of the data is saved. Every single key and value in the hashtable is a String (which is serializable), but when I go to load the object, the hashtable I load is empty!
Thanks for the help,
~Matt
<<Less