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

Is that servlet is pure java object or not?

644


I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>

2533


What are the disadvantages of storing session state in cookies?

630


What is a generic servlet?

520


Why is a constructor needed in a servlet even if we use the init method?

608






Why are http servlets used in programming?

546


What are different ways for authentication of servlet?

529


What is the structure of the http response

677


What do you mean by cgi?

533


What is meant by a servlet?

604


Explain Action Servlet?

624


List out difference between a JavaBean from a Servlet?

566


What's the advantages using servlets than using cgi?

556


Describe in brief RequestDespatcher?

596


How to handle exceptions thrown by application with another servlet?

615