Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Permanent Redirecrt by http headers

 
meKenz
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pplz,
how automatically bookmarks will be updated and point to new location by using permanent redirect using http headers
i have tried and not found any changes in bookmarks
using the following code
res.setStatus(301); // SC_MOVED_PERMANENTLY
res.setHeader("Location","NewServletUrl");
Any comments : ?
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not believe that you should see a change in
the client side bookmarks. The browser would have
to accept the response and act on it to make the
change. Your servlet should not be able to change
files on the client without some user action.
Even if the browser were built to accept the
status and allow changes to the bookmarks, it
should (IMHO) still prompt the user before making
such a change.
HTH,
Joe
 
meKenz
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe ,
so what is the difference between in Permanent Redirect and Temporary Direct .
as i read in Book Inside Servlets by Dustin R.Callaway on page # 234 its written on 4 para
that
" '301 Move Permanently' status Code , the browser should update any bookmarks pointing to the old location."
Any Idea regarding this?
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - Callaway's book does indeed say that.
Here's where it comes from:
The HTTP/1.1 specs are at www.w3.org.
The section on 301 responses says (in part):
"Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible."
Whether that actually happens is going to be very browser and browser-option dependent.
HTH, Guy
[ January 22, 2002: Message edited by: Guy Allard ]
 
meKenz
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea which browser supports this option?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic