I am developing a Application using JSP , Servlets and MySQL as Database .
The FrontEnd is made of DOJO library JavaScript and JSP and it displays all the Elements Present in the Database Table .
One of our requirement is that whenever there is a change ( A New Entry that is added in the Table) , it should immed开发者_StackOverflow中文版iately reflect in the Front End .
This is not a Periodical refresh ,and it may happen at anytime like after 1 Hour 2 Hours or even after 5 Hours )
Please sugget what is the best approach to deal with this requirement ??
Actually you still need to periodically check if your db changes or not, then you can update your pages. To update it without user refreshing, try AJAX and polling.
For more details pls visit here.
Here are some links that shows demo of Ajax in jsp:
- ajaxprojects
- ajax-programming-with-jsp-and-servlets
- w3schools Ajax
- roseindia Ajax
Hope this helps.
精彩评论