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
What is the difference between encodeRedirectUrl and encodeURL?
What is the life-cycle of servlets?
What is servlet interface?
What is the workflow of a servlet?
What is a web application and what is it’s directory structure?
What is difference between server and servlet?
Why is http protocol called as a stateless protocol?
Difference between get and post in java servlets?
Explain the jar and war files in servlet?
The code in a finally clause will never fail to execute, right?
What is the disadvantage of cookies?
what do you understand by url rewriting?
How httpservlet is different from the genericservlet?
Difference between forward() method and sendredirect() method ?
What exactly is a servlet?