Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between sendRedirect and Refresh  RSS feed

 
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: 17309
11
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
Boost this thread!