[ZPT] [Bug] Browsing HTML source can render ZPT (and therefore fail)

Dieter Maurer dieter@handshake.de
Wed, 26 Sep 2001 18:37:33 +0200 (CEST)


Just met a nasty bug:

  I had added a relative stylesheet reference to my ZPT.
  To my surprise, then, I have been unable to browse
  the ZPT HTML source. It reported
  "undefined XXX in options/XXX".

The analysis revealed:

  PageTemplates derive from "Bindings" and therefore
  bind (by default) "traverse_subpath".

  The relative stylesheet reference was expanded into
  an absolute URL of the form "<PageTemplateURL>/style.css".
  Because "style.css" was not a member of the stylesheet,
  it has been catched by "traverse_subpath",
  the ZPT was rendered and, of course, had missing
  parameters.

  The same will happen with almost any other relative URL
  (which does not start with '..'). Browse HTML source
  will fail often....


Options:

  *  Let "Browse HTML source" set the HTML "base"
     tag to get the same reference point we would
     have for the rendering of the ZPT.


  *  Do not bind "traverse_subpath" and let acquisition
     resolve the problem.

     Are there relevant use cases for "traverse_subpath" binding?



Dieter