How to refresh a servlet from the browser (IE 4)
Hello All,
I have a servlet , which brings some table data, and I would like to refresh the call to the servlet on a time delay... How to do it?
My thinking is , to use an applet , which will run hidden and keep making the http request on a thread delay, IS IT possible?
or IS there a simple HTML/JavaScript function to accomplish this task?
[373 byte] By [
kumaranm] at [2007-9-26 9:45:29]

look at the code below:
public void doGet(HttpRequest request, HttpResponse response) {
response.setHeader("Refresh", "5");
PrintWrite writer = response.getWriter();
writer.println("<img src='shot.jpg' alt='a shto from my web cam'>;");
writer.flush();
response.flushBuffer();
}
Hello,
Question: Yes, this works, however, my entire page is refreshed and I see that flickering for every 5 seconds...
Is it possible to refresh the servlet only when certain data changes (basically I have status/reminders displayed next to the image and this could change on the server, I would like to poll the server somehow and check this values and if they are changed , then only refresh the servlet)..
Any suggestion(s) appreciated. Tx
Kumaran
Hello Kumaran, I am facing exactly the same problem as you. If you managed to solve the problem, I would appreciate any code that you can send me. I am new to servlet programming and any help would be appreciated. My email is sh1974@rediff.comThanks