Ratan:
I would be highly obliged if someone can guide me in refreshing the Servlet page, say after n seconds and also should refreshed when any data is updated .
Also this servlet should be written the data into a FILE so that we can directly access this file itself.
Jesse:
The second is not possible. HTTP is a disconnected protocol so there is no way for the server to know which users are currently looking at that page.
I'm not 100% convinced of the impossibility. I envision a
thread that polls the data file for changes, resulting in a server-push when a change event happens. Haven't done this myself, but I think it is possible.
Now, as to whether doing this is
advisable, that's something else altogether. You would not only have to impliment server-push technology (there is an example in the O'Reilly Servlets book), but you'd also have to be concerned with the thread safety of this approach.
Personally, I'd be inclined to use a database instead of a file.
PCS
Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!