public class MyServlet extends HttpServlet { private static class MailerThread extends Thread { public void run () { while (true) { // do something synchronized (this) { wait (10*60*1000); } } } }
// the servlet init method public void init () { MailerThread thread = new MailerThread (); thread.setDaemon (true); thread.start (); }
// ... doGet, etc. ... }
-Erik
Eric C wrote:
Use cron under unix and/or a java app that would use Javamail classes. Of course you can do it inside a servlet.
----- Original Message ----- From: "Prince" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Saturday, November 01, 2003 8:51 AM Subject: HOW CAN I USE THREADS IN TOMCAT
wellHi, I need to send a mail automatically at 10 minutes interval. how can i do this? how can i activate threads in tomcat? regards Prince
----- Original Message ----- From: "Bill Barker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 01, 2003 1:00 PM Subject: Re: Opinions
The recent port of the 3.3 variable-substitution to Tomcat 5 may very
news:[EMAIL PROTECTED]solve your problems here :). The ports are supposed to move to commons-digester, so should be available in 4.1.30 as well.
"Francois JEANMOUGIN" <[EMAIL PROTECTED]> wrote in message
for
Hu! It's in early developments or is it suitable for production ?It's ready for production. People are already using it in production
with tomcat 5. Of course, I'm biased ;)
Well, there is that beta flag in front of tomcat5 that tell me that your opinion is more than biased :). Of course, I saw a mail telling that the beta flag is related to specification instability (not code), anyway...
It's a Developer, rather than Sysadmin, option. Chances are you won'tWell, that does not help that much. I hope that there will be a
need to worry about it as you'll use commons-daemon with tomcat, which
already does the required jsvc invocation for you.
configuration scheme that'll let easily define user/group/port and so on
the connectors. Just waiting for a sysadmin point of view :).
Thanks,
François.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- http://www.spectacle.ca/ The New Online Source for Live Music in Montreal .::514.286.1699::.