I am developing an Email client using Java Mail API. Now, to regularly check for New Mails, I want to call a page "Synchronize_update.jsp"
我正在使用Java Mail API开发电子邮件客户端。现在,要定期检查新邮件,我想调用一个页面“Synchronize_update.jsp”
I have to do it through a JSP as I need to also execute a piece of JavaScript Code towards the end which is basically an AJAX Call to Notify_all_for_new_mail.jsp.
我必须通过JSP来完成它,因为我还需要在最后执行一段JavaScript代码,这基本上是对Notify_all_for_new_mail.jsp的AJAX调用。
Can any one suggest me a solution? I am on a Linux Virtual server with command line full access.
任何人都可以建议我一个解决方案?我在Linux虚拟服务器上,具有命令行完全访问权限。
1 个解决方案
#1
0
You could use java.util.Timer and java.util.TimerTask classes if your scheduling is simple, or use Quartz scheduler if you wish to achieve cron like scheduling.
如果您的调度很简单,可以使用java.util.Timer和java.util.TimerTask类,如果希望实现类似调度的cron,可以使用Quartz调度程序。
Here is example using Timer.
以下是使用Timer的示例。
For emulating browser functionality in your code you can use HttpUnit.
要在代码中模拟浏览器功能,可以使用HttpUnit。
I think using above tools you can achieve your functionality. Hope this helps.
我认为使用上述工具可以实现您的功能。希望这可以帮助。
#1
0
You could use java.util.Timer and java.util.TimerTask classes if your scheduling is simple, or use Quartz scheduler if you wish to achieve cron like scheduling.
如果您的调度很简单,可以使用java.util.Timer和java.util.TimerTask类,如果希望实现类似调度的cron,可以使用Quartz调度程序。
Here is example using Timer.
以下是使用Timer的示例。
For emulating browser functionality in your code you can use HttpUnit.
要在代码中模拟浏览器功能,可以使用HttpUnit。
I think using above tools you can achieve your functionality. Hope this helps.
我认为使用上述工具可以实现您的功能。希望这可以帮助。