This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: generating HTTP (or MIME) headers without being a servlet
- From: Per Bothner <per at bothner dot com>
- To: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Fri, 17 May 2002 22:23:15 -0700
- Subject: Re: generating HTTP (or MIME) headers without being a servlet
- References: <DFD875E85664D3118FA6080006277DE70582332E@U8PN2.blf01.telekom.de>
Hoehle, Joerg-Cyril wrote:
> I tried out a file brltest.brl:
> [(begin (require 'http)
> (response-header "foo" "bAr"))
> ]
> <body>
> [(define foo 123)]
> Hi there [foo]
> </body>
> [(display "hello World!")]
You might try:
$ kawa --krl --output-format cgi /tmp/brltest.brl
foo: bAr
Content-type: text/html
<body>
Hi there 123
</body>
hello World!
> It's interesting how I once get "foo=..." (attribute syntax), useful for HTML/XML,
> and once " foo=...", which is almost right, except that I don't know where that
> leading space comes from.
It's a complicated bug involving interaction between the goals of
putting spaces between multiple values, and how prompts are handled.
> I believe the response-header etc. functions are useful even without a servlet.
> That's why I'm trying to make use of them.
You might want to look at CGIServletWrapper. It's wrapper that runs
Kawa-compiled servlets as a CGI script. You can possibly be modified
to your needs.
> It's unclear yet whether the response-header results must be "the initial
> result values", i.e. all come first, or whether response-header can
be called
> anywhere amid body generation (implies complete buffering of output
> somewhere).
The former.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/