This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: krl servlets & concurrency
- From: "62945" <62945 at bol dot com dot br>
- To: "kawa" <kawa at sources dot redhat dot com>
- Date: Sun, 8 Aug 2004 15:11:45 -0300
- Subject: Re: krl servlets & concurrency
Chris wrote:
> The semantics between JSP and KRL are a little
different here. To use
> Java lingo, in the KRL example the "x" variable is
global and
> accessible across all servlets while in the JSP
example "x" is local
> to that servlet.
By "all servlets" I understand you mean "all servlet
threads" since the default behavior of the (servlet)
container is to have one instance of each servlet
serving multiple (client) requests, one thread per request.
> > but shouldn't (or couldn't) "x" in the kawa
translation be placed
> > inside "apply".
>
> You could do that yourself by using a let form instead
of a top-level
> define. Then the two examples would be equivalent and
produces
> similar code.
The technique you offer makes it quite difficult to mix
text/data and code in krl, since there can be no
top-level vars. Inside a "let" you cannot put raw text.
I guess there are only two objects you could safely use,
namely "request" and "response". Otherwise the only safe
things to use are procedure calls.
One could hack an exclusive environment using the
session cookie and closures, something like:
"(env-put session-cookie-value 'name value)"
"(env-get session-cookie-value 'name)"
but this would make the krl page ugly and rather
inefficient (using macros might make it better though).
Shouldn't (ou couldn't) KRL semantics follow JSP, since
it seems the most usual and practical ?
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/