Previous: ZD-Version| Zot-Dispatch 2.0| Next: Macro Variables

Zot-Dispatch: More on ZD-Reflect


The main reason that this section on ZD-Reflect was left until later in the documentation is that the values of the second and third fields of ZD-Method input elements for ZD-Reflect do not always conform to the names of those two fields (Destination and Template). It is easier to learn the exception after fully understanding the rule.

In Zot-Dispatch 1.0 the Destination field was left unused, but in this version of ZD the Destination field is used to specify what to respond with and/or how to respond to the client.

There are currently three possible values for the Destination field of ZD-Method when the Dispatch Method is ZD-Reflect, and the possible values of the Template field are dependent upon them:


direct

If direct is in the Destination field and the Template field is a file: or body: reference to a template, Zot-Dispatch will return the source of the template itself without doing any substitution of values into it.

If, however, the value of the Template field is a URL, Zot-Dispatch will return to the browser a Location: header instructing the client to retrieve that URL directly.

Examples:
The first example uses direct and a template. The HTML source for the form is:

  <FORM METHOD=POST ACTION="http://www.oac.uci.edu/cgi-bin/zd-2.0.cgi">
    <INPUT TYPE=hidden NAME=ZD-Method VALUE="ZD-Reflect;$direct-or-not#;$template#">
    Enter your name: <INPUT TYPE=text NAME=name><BR>
    <INPUT TYPE=radio NAME=direct-or-not VALUE="direct">Use <CODE>direct</CODE>
    <BR>
    <INPUT TYPE=radio NAME=direct-or-not VALUE="">Don't use <CODE>direct</CODE>
    <BR>
    <INPUT TYPE=hidden NAME=template VALUE="body:This is a simple template, $name#.">
    <INPUT TYPE=submit VALUE="Submit Example">
  </FORM>
Enter your name:
Use direct
Don't use direct

plaintext

If the Destination field contains plaintext then the behavior of Zot-Dispatch will be nearly identical to when plaintext is not in the Destination field. Substitution will still take place, and URLs will not be returned using the location header. The difference is that the Content-Type sent to the browser will be text/plain. This keeps the browser from interpreting the HTML code in a document.

direct-plaintext

If the Destination field contains direct-plaintext, the behavior of Zot-Dispatch will be exactly the same as with direct above, only if Zot-Dispatch returns the source of a template, it will send the Content-Type: as text/plain so that the client will not format any HTML.


Previous: ZD-Version| Zot-Dispatch 2.0| Next: Macro Variables
Zot-Dispatch 2.0
Written by Leonard Megliola III (lmegliol@uci.edu)
Last Revised 02 January 1996