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

Who is responsible to create the object of servlet?

938


In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

790


Write a command to get actual path of a servlet to the server?

772


If a servlet is not properly initialized, what exception may be thrown?

884


What is the difference between Server and Container?

910


What is servlet instance?

773


How can the referrer and the target urls be used in servlet?

743


Explain the jar and war files in servlet?

822


How does tomcat servlet container work?

832


Can you call a jsp from the servlet?

765


Which method of the httpservletrequest object is used?

800


What are different methods of session management in servlets?

1018


What exactly are the functions of servlet?

825


What do you mean by singlethreadmodel interface?

810


Why jsp is better than servlet?

756