Reputation: 4295
I am relatively new to spring. I would like to know if there are any possible ways to automatically poll the database using Spring 4. The user would not need to refresh any pages for the code to fire. I would need my jsp page to automatically poll the database every few seconds.
Upvotes: 0
Views: 422
Reputation: 35096
I think you are confused about how JSP works. JSP is a graphical facade on Java Servlets, which (normally) take in an http request, and returns some html or an error code. That's the servlet's entire life span... the servlet will re-run with every incoming request.
To do what it seems you want to do, you will need to find a solution in JavaScript / JQuery. A commenter has suggested you look up on AJAX programming - you should take his advice.
Upvotes: 1