Automatically Refreshing a JSP

By: Emiley J.  

The following scriptlet code adds a Refresh header that specifies a 60-second interval for refreshing the JSP. Place this code at the top of the JSP before any content appears:

<% response.addHeader("Refresh","60"); %>

If you want to refresh the JSP to another web component or page, use this syntax:

<% response.addHeader("Refresh","10;
  http://localhost:8080/home/thanks.jsp"); %>

Archived Comments

1. As we hate having to pay actual cash to progress in our video games, we
decided to make our

View Tutorial          By: simcity buildit at 2017-05-09 11:38:14

2. How can I make the refresh dependent on changes to a certain servletcontext attribute ? Thanks
View Tutorial          By: Gideon at 2016-08-17 15:59:16

3. Gives a syntax error
View Tutorial          By: Siddharth at 2015-06-10 05:15:00

4. Yesu. Thenk a u vely muchos. HURRRRR
View Tutorial          By: hurr durr at 2013-09-19 19:50:23

5. thx a lot
View Tutorial          By: lupita at 2013-09-04 18:58:40

6. Wow it's working great.....
View Tutorial          By: nazeer at 2012-03-29 06:04:42

7. I am trying to refresh an image, not the entire page. I tried using the following code and also trie
View Tutorial          By: PM at 2011-10-10 04:03:24

8. Its working ,,, gud stuff.
View Tutorial          By: Atul at 2011-07-21 10:34:44

9. hello
View Tutorial          By: ashish at 2010-07-31 00:30:43

10. it is good
View Tutorial          By: kamal at 2009-11-01 19:58:54

Most Viewed Articles (in JSP )

Latest Articles (in JSP)

Comment on this tutorial