Take the 2-minute tour ×  We have a page that calls a servlet
every minute. This servlet connects to another website to get
some data, process this data, then sends the response through
the response.getWriter() method.  If there are two different
users accessing the page at the same time, two requests would be
made to the same servlet. Though there is still only one
instance of the servlet, there would be two processes (perhaps
on two different threads) that would try to connect to the other
website.  What we want is to have another class/method/servlet
that would connect to the other website, process the data, then
save it to cache/session. This class/method/servlet has to be
invoke/called every minute so that when the first servlet is
called from the page, it would just get the data from the
cache/session and not try to connect to the website. How do we
implement this? (problem is how the new class/method/servlet
would be invoke/called automatically every minute without having
to make a request from a page)