Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

response.addHeader() method  RSS feed

 
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?
 
Ranch Hand
Posts: 405
  • 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!!!
 
Sheriff
Posts: 9611
37
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...
 
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
 
Author and all-around good cowpoke
Rancher
Posts: 13078
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!