How can a servlet refresh automatically if some new data
has entered the database?

Answer Posted / vikas kapoor

Well you can use

response.setHeader("Refresh",5);

This will update the browser after every 5 seconds

response.setHeader("Refresh","5",
URL="http://localhost:8080/myServlet/MyRequest.do

This will refresh MyRequest.do after 5 seconds

Is This Answer Correct ?    28 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When jsessionid is created?

828


Are Servlets Thread Safe? How to achieve thread safety in servlets?

798


What is servlet container?

906


What is the process for chaining servlet?

826


Can you explain in detail 'javax.servlet' package?

796


Write a simple servlet program to print the contents of html.

829


Explain Action Servlet?

849


Explain servlet.

824


Given the request path below, which are context path, servlet path and path info?

798


What is load-on-startup in servlet?

838


What is java servlet?

834


Whether we can get deadlock situation in servlets?

845


What exactly are the functions of servlet?

853


Explain is servlet mapping?

801


What is servlet attributes and their scope?

813