Hi,
    Here is the one of the possible ways. Consider taking all of these,
(All numbers)

(Hour+minute+second+day+month+year)

Looks like a Long string, but you can use this string to create your unique
file name. Since the code is going to be running on the Server, the filename
generated will always be unique. Also you can get all of them from single
object (calendar). So it should not be time consuming too.

Sudhir
[EMAIL PROTECTED]
http://www.javacommerce.com


----- Original Message -----
From: Sachin S. Khanna <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 13, 2000 2:03 AM
Subject: Re: How to generate unique filename each time run the jsp


> Well one possible thing to do could  be the following :
>
> private static int x = 0;
>     public synchronized static int getId(){
>         return ++x;
>     }
>
> And add the int value returned by the getId() method with the name of the
> user.
> Just a suggestion :-).
> Have a nice day.
> With regards,
> Sachin S. Khanna.
> www.emailanorder.com
> ----- Original Message -----
> From: Tiana Zhang <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 12, 2000 11:59 PM
> Subject: How to generate unique filename each time run the jsp
>
>
> > Hello, I need suggestion for the following task:
> >
> > I have a jsp(jsp1) page which is gonna to invoke some other program, the
> result
> > is that jsp1 is gonna to create an Html file. This file will be loaded
by
> > another jsp(jsp2) file. My problem is how can I make the name of this
html
> file
> > unique (i can specify the name anyway I wanted). The reason I want to do
> this is
> > to avoid two users run the jsp1 file at the same time and write to the
> same html
> > file. After jsp2 loaded the corresponding html file, this file will be
> deleted.
> >
> >
> > Any suggestion?
> >
> > Thanks a bunch.
> >
> > Tiana
> >
> >
>
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to