[Prev][Next][Index][Thread]

Re: help: redirect and carry state



At 11:00 AM -0500 1997-01-23, Bill Anderson wrote:
>hi,
>
>i would like some help on this. i have a :search url, that depending on the
>search keys one of the desired results is to "go to" a :html-computed-form.
>meaning i would like to "invoke"/"create" a form dynamically which would
>have it's own response function.
>
>question: is invoking a http:redirect-request the correct way to handle this?

A redirect is really a way to dispatch to another url.  Your options for
carrying state are to pack it into a search url or use the cookie mechanism
to return state with the redirect that the client will submit when it resolves
the redirect.

	http://wilson.ai.mit.edu/cl-http/cookies.html

Redirects are more limited than response functions and
they involve an extra transaction. Redirects are normally used to handle
relocation of URLs or on the root page. They help reduce duplicate
urls, ergo, increase site abstraction and reduce site maintenance.

>question: if so, how do i pass arguments from the response function of the
>:search url to the form-function of the :html-computed-form url?

I would abstract the inside of the form function and call it from the
response function for the search url. Recall that the HTML for a
form contains within it the URL where the form should be submitted
(the form response url).

You probably want to play with the content-location header (specificed
from the with-resopnse... macro) to ensure that the user would reload the
correct form. This either reflects the search url submitted or requires
use of cookies to record relevant state information.

>
>also, in this same sequence, one of the possible actions of the
>response-function of the :html-computed-form url is to send a postscript
>file back to the client. again, is using the redirect-request function the
>correct way to do this? what are other options?

A redirect is probably good here in that in avoids URL duplication. The 
other option is to copy the postscript within an appropriate call to with-response.... with appropriate content-location headers.

Would PDF be a better bet than postscript?




References: