Jsp Auto Refresh
# JSP Auto Refresh
Imagine if you wanted to live-stream a game score, or the real-time status of the stock market, or the current foreign exchange allocation, how would you implement it? Obviously, to achieve this kind of real-time functionality, you would have to refresh the page regularly.
JSP provides a mechanism to make this task simple, allowing the page to be automatically refreshed at timed intervals.
The simplest way to refresh a page is to use the `setIntHeader()` method of the response object. The signature of this method is as follows:
public void setIntHeader(String header, int headerValue)
This method notifies the browser to refresh after a given time, in seconds.
* * *
## Page Auto Refresh Program Example
This example uses the `setIntHeader()` method to set the refresh header, simulating a digital clock:
Auto Refresh Example
YouTip