[Zope3-dev] Redirects

Adrian van den Dries az@CANTANKER.NET
Tue, 28 Jan 2003 14:44:02 +1100


quoth Tres Seaver:

>You then have the bad case of having the URL which the user can see in
>the browser not correspond to the page being viewed.  For instance, if
>you posted to '/path/to/document/document_edit', the logical thing to do
>is to redirect to '/path/to/document/document_view', perhaps with a URL
>parameter which includes a status message;  otherwise the user ends up
>viewing the page in the wrong context (and can't therefore reload the
>page to see other updates).

This still feels wrong to me: in your example document_view is not
(necessarily) the logical result of document_edit.  It especially
isn't the result if you're passing random parameters to it:
document_view will need to know about all possible transitions to that
state, which in my mind violates the principle of loose coupling.

I would much prefer an explicit method, document_edited for example,
which then *called* document_view or whatever.

>From RFC 2616:

Ah yes, sorry about this.  I expected RFC2068 to have a note about its
obsolescence.

a.

-- 
Cantanker /
---------/-------------
        / cantanker.net