Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between sendRedirect and Refresh

 
Meng Tan
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not sure about this:
What is the difference between using a sendRedirect method of the Response object and sending a "Refresh" header with a refresh time of 0?
Do they have the same effect?
Also, how come the "Refresh" header is not in the HTTP 1.1 specification?
Thank you very much.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am unfamiliar with refresh, but I would assume that would refresh the same "Page", whereas sendRedirect sends the client to a different "Page"
for instance the client requested ServletA, when you refresh you get ServletA again, whereas sendRedirect would send the client to ServletB.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic