A
A
Artem2015-09-08 12:39:26
Java
Artem, 2015-09-08 12:39:26

How to create a web application in Java that fires itself after a given time (presumably a servlet, under Tomcat)?

In general, you need the server to call an application that polls a couple of sites to get information and store it in the database.
Called, say, every hour or 30 minutes (a given time).
How to do it under Tomcat.
As I understand it, theoretically, this can be done by an application that starts at the start and simply falls asleep in a cycle (blocks its own thread) and wakes up at a certain time. but this is not very good
. Tomcat probably has a way to configure the servlet so that it is called at a certain frequency by itself, without any user requests

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nagibator8000, 2015-09-08
@nagibator8000

quartz or Spring Scheduling

E
Evgeny Akhmetov, 2015-09-08
@asperin2

The easiest option is to write a script that is called by cron ( https://ru.wikipedia.org/wiki/Cron)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question