Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.addHeader() method

 
pratapsiva sivakumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
inside the dopost() method of a servlet i have a line

response.addHeader("refresh","1");

what does the above code mean?
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It will auto refresh your page on submit after every 1 second time duration.


Cheers!!!
 
Ankit Garg
Sheriff
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the browser will see that header, the page will be refreshed after 1 second. I won't say every 1 seconds as the next time it is up to the servlet to add that header or not. See more details on this page...
 
Surajsingh Thakur
Ranch Hand
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even i think its Refreshing the page in the client-Browser
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking through the RFC 2616 for HTTP1.1 I dont see a "refresh" header defined for responses so this would depend on non standard browser behavior. See the link Ankit gave for the Meta alternative.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic