开发者

Cron job to call a JSP Page with Javascript

开发者 https://www.devze.com 2023-01-14 20:00 出处:网络
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\"

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"

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.

Can any one suggest me a solutio开发者_如何学Pythonn? I am on a Linux Virtual server with command line full access.


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.

Here is example using Timer.

For emulating browser functionality in your code you can use HttpUnit.

I think using above tools you can achieve your functionality. Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消