[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Xavante/Cgilua: custom handler - please critique
- From: William Trenker <wtrenker@...>
- Date: Sun, 14 Aug 2005 15:33:01 -0400
On 8/10/05, Andre Carregal <carregal@fabricadigital.com.br> wrote:
> > Javier Guerra wrote (refering to William Trenker):
>
> maybe you're proving me wrong, and you really need more
> flexible handlers than the stock CGILuaHandler
>True, but I still couldn't figure out what is needed that the current
>handler can not do. CGILua does not handle HTTP status yet,
>but we are working on that.
Maybe it's me -- maybe I'm missing something.
How would you write a Xavante/config.lua simplerule to direct
everything to a single cgilua script? Something like:
local simplerules = {
{match = {"/", "/*"}, with = xavante.cgiluahandler.makeHandler
("/webdir")},
}
(I realize the above doesn't work. I get an error to the effect that
"There is no handler defined to process this kind of file ()". I just
listed the above as pseudo-code.)
Remember, in my original post, that I want to programmatically
redirect based on an analysis of each request, including any cgi data
transmitted in the request. So I would first need the ability to have
all requests processed by a master script which analyzes all available
request data.
Then, I would like to invoke other scripts from within that master
script. For instance after analysing the request data, including the
cgi POST/GET data, I determine I need a password from the user. So,
from within the master script, I want to send a password form back to
the browser to gather that user input. Of course, I would prefer to
use a .lp script for defining such forms. When the user then submits
the password form, the resulting request data would simply be
returned to the master script which processes the password data and
carries on from there, possibly redirecting the browser to an Internet
site using httpd redirection.
The master script would retain state and I would hope to use
cgilua.session for this. (Again, cgilua already has code for sessions
so I would hope reuse it rather than rewrite it.)
As I say, maybe I've overlooked something and cgilua can do what I'm
looking for. Perhaps I'm missing a key concept in using xavante and
cgilua as building blocks for customized web applications development.
Thanks for any light you can shed on this.
Regards,
Bill