[Zope-dev] __before_publishing_traverse__ calls RESPONSE.redirect(): is there another way to change the browser URL?

Casey Duncan casey@zope.com
Fri, 27 Sep 2002 15:25:23 -0400


What you are looking for sounds like "stateful" through-the-web functiona=
lity.

I think you should use sessions to remember the form fields and/or whethe=
r the=20
user has been to this URL before.

I am suspect of an app design that makes a single URL mean different thin=
gs in=20
this way, however. I suspect there is a much easier way to accomplish wha=
t=20
you want that does not use traversal hooks or magic redirect descriminati=
on.

I'm still not sure I'm seeing the big picture of what you are really tryi=
ng to=20
accomplish here.

-Casey

On Friday 27 September 2002 02:53 pm, Craeg K Strong wrote:
> Hello:
>=20
> This is a good idea, and would solve the problem as stated.
>=20
> Unfortunately, it conflicts with my other (heretofore unstated)
> requirement that
>=20
> "all URLs shown in the browser should be bookmarkable
> at all times."
>=20
> Once a user bookmarks foo?I_am_an_application_controlled_redirect=3D1
> and comes back to it, it is no longer telling the truth ;-)
>=20
> --Craeg
>=20
> Oliver Bleutgen wrote:
> > Craeg K Strong wrote:
> >=20
> >> However, I would like to distinguish between two cases:
> >>
> >> a) Direct Navigation:   e.g.I am a user and I just typed in
> >>
> >>=20
http://acme.com/myapp/contracts/TRW-001/taskorders/TO-01/invoices/DSDC-00=
1-9301=20
> >>
> >>
> >> into my browser
> >>
> >> b) Application-Controlled:   e.g. I am the application, I did some=20
> >> processing
> >> based on a button the user pressed in some form somewhere and determ=
ined
> >> that the next URL should be
> >>
> >>=20
http://acme.com/myapp/contracts/TRW-001/taskorders/TO-01/invoices/DSDC-00=
1-9301=20
> >>
> >>
> >> =3D=3D=3D=3DNow here is the issue=3D=3D=3D=3D
> >>
> >> In both cases above, the REQUEST object looks identical.   Is there=20
> >> any way
> >> that I can distinguish a GET that is the result of a REDIRECT from o=
ne=20
> >> that
> >> is not?
> >>
> >> I would think this would be of interest to others.  For example, if =
I=20
> >> move my
> >> web page and put a redirect from the old address, I could track how =
many
> >> people came to my web page directly versus those that are still usin=
g the
> >> old address and are getting redirected.
> >=20
> >=20
> > raise 'Redirect', newURL+'?I_am_an_application_controlled_redirect=3D=
1'
> >=20
> >=20
> > HTH,
> > oliver
>=20
>=20
>=20
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>=20