This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generating HTTP (or MIME) headers without being a servlet


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]