[Zope] Forwarding problem
Dieter Maurer
dieter@handshake.de
Mon, 17 Feb 2003 00:03:34 +0100
Kevin Carlson wrote at 2003-2-14 17:04 -0500:
> I have a dtml-document that displays some information given a database
> key as an argument in the request. I call the document as
> "/document?id=239".
>
> I created a script to receive similar requests: "/docscript/239". This
> way I could get the key from the traverse_subpath, add 'id' to the
> request and forward control on to the original dtml-document.
>
> If I call the document as "/document?id=239" things display properly.
> If I call the script, all the basic content on the resulting page is
> right, but the style sheet and graphics aren't picked up in the
> process. Both the script and the dtml-document are in the same folder.
> The script is below. Any ideas anyone?
That's almost surely an effect of relative URL references.
As a general rule, avoid relative URL references to static
content because with high probability that makes caching
much more difficult.
In your case, the relative URL references go through "document"
which blocks Zope's normal acquisition because the remaining
URL path is put into "traverse_subpath" and not looks up
normally.
Access them via absolute URL's and your problem will go away.
If you really do not want to follow this advice, you must teach
your script to deliver the correct objects when they are
referenced in the "traverse_subpath".
Dieter