Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to generate unique filenames??

843841Apr 15 2003 — edited Apr 16 2003
i need to be able to generate unique files from a servlet..

my initial instinct was to use the seesion id as part of the filename, however as this file will be embedded in the responding html, this is not safe, as the user will only have to look at the html source to view a session id value.

i am now considering to use the date/time of the creation of a session as the unique identifier for the file, however this will not work if two sessions can be created at the same time.

my question thefore is if no two sessions can have the same date and time?

if not.. can anyone give me an idea as how to produce unique filenames?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2003
Added on Apr 15 2003
9 comments
1,084 views