How can a servlet automatically updated by its data without refreshing?take one example of one sensex site. the corresponding data are shown in a scrolling manner. how they can automatically be refreshed after some time. without refreshing the page.

Questions by shubh

Showing Answers 1 - 10 of 10 Answers

sudhakar

  • Nov 11th, 2005
 

hi

The web page can be refreshed automatically by using this method in your code

setHeader("refresh","<amt of time>");

  Was this answer useful?  Yes

subbu

  • Feb 20th, 2006
 

Please give me the code for auto refreshing or just for refreshing the page

  Was this answer useful?  Yes

Anuj Kumar Ratra

  • Feb 25th, 2006
 

If i am thinking in the right direction u want to only update a portion of the page not the entire page.

The entire page mechanism is easy using javascript autorefresh

setTimeout("window.location.reload()",1000)

Enter this script in the head portion of the html page in script tags

But the best solution is to use AJAX. If you are using gmail or meebo u would understand what it is all about.

cheers

  Was this answer useful?  Yes

angelina

  • Apr 11th, 2007
 

we can also use either of following in <head> tag of html/jsp.


<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">  

or

<%
 response.setHeader("Cache-Control","private");//HTTP 1.1
 response.setHeader("Pragma","no-cache");//HTTP 1.0
 response.setDateHeader("Expires",0);//Prevents caching at the proxy server
%>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions