Is thread the best option?
Hello!
I am using servlets in Web Server and I need advice on how to do something I need...
I need to have a calendar in a servlet webpage with time and date and I need to do an action on a data and time specified by the user...
How can I do this?? After setting the date and time what is the easiest option??
Get the time at the moment and the future time, make the difference and run a thread till reaches 0 and then call a certain class??
Get the future time and keep checking the current time on a thread??
Thanks
Re: Is thread the best option?
Most servers should provide a scheduling facility for this kind of thing, so the first place to look would be the server API docs. But failing that, you could use a ScheduledExecutiveService such as ScheduledThreadPoolExecutor.