It's not a secret anymore!
The moose likes Servlets and the fly likes Permanent Redirecrt by http headers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Permanent Redirecrt by http headers" Watch "Permanent Redirecrt by http headers" New topic

Permanent Redirecrt by http headers


Joined: Jan 20, 2002
Posts: 7
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
Any comments : ?
Joe Gilvary
Ranch Hand

Joined: May 11, 2001
Posts: 152
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.

Joined: Jan 20, 2002
Posts: 7
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
" '301 Move Permanently' status Code , the browser should update any bookmarks pointing to the old location."
Any Idea regarding this?
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Hi - Callaway's book does indeed say that.
Here's where it comes from:
The HTTP/1.1 specs are at
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 ]

Joined: Jan 20, 2002
Posts: 7
Any idea which browser supports this option?
I agree. Here's the link:
subject: Permanent Redirecrt by http headers
jQuery in Action, 3rd edition