Can you use the File Object's createTempFile() method?  It lets you specify
the extension as "html" if that's what you need.




-----Original Message-----
From: Norris, Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 12, 2000 3:03 PM
To: [EMAIL PROTECTED]
Subject: Re: How to generate unique filename each time run the jsp


Hello!

        What my company is doing is creating a filename made up of the
user's id and a long timestamp.


                Hope this helps!

                Mike

> ----------
> From:         Holmes III, William S[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list about Java Server Pages specification and
> reference
> Sent:         Friday, May 12, 2000 12:06 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: How to generate unique filename each time run the jsp
>
> Hi Tiana,
>
> Just an idea, but try putting a numerical timestamp (long) in the filename
> (including milliseconds) and append on a counter that continuously cycles
> through to 10000. (ie. file881100..._00001.html)
> The counter is just to insure two files are generated with the same
> timestamp.
>
> Bill
>
> > -----Original Message-----
> > From: Tiana Zhang [SMTP:[EMAIL PROTECTED]]
> > Sent: Friday, May 12, 2000 2:29 PM
> > To:   [EMAIL PROTECTED]
> > 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