This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: various kawa check-ins
Per Bothner <per@bothner.com> writes:
> Nic Ferrier wrote:
> > It perhaps isn't important but your CGI handling stuff does not
> > implement the spec in one very obvious way.
> >
> > Servlet's expect to have their init(ServletConfig) methods called
> > before the service method is called. Your main() doesn't do that.
>
> How about the appended file? Of course getServletContext - and lots
> of other methosd - are null, so code that depends on them will fail
> or even crash.
public static void main(String[] args)
{
try
{
CGIServletWrapper wrapper = new CGIServletWrapper();
Class servClass = Class.forName(args[0]);
wrapper.servletName = args[0];
HttpServlet servlet = (HttpServlet) servClass.newInstance();
servlet.init(wrapper);
servlet.service(wrapper, wrapper);
wrapper.flushBuffer();
}
catch (Throwable ex)
{
ex.printStackTrace();
System.exit(-1);
}
}
That's much better. They'll be able to open pool connections and stuff
now.
Incidentally, one big question for servlets in dynamic languages like
Scheme is: how far does dyunamic scope go?
DS is really useful and languages like JSP frig it with session scope
and page scope and all that guff. Of course Scheme could eaily have
it's environment extended to look up bindings in a session table and a
page table and an application table... etc...
But how far to go with that sort of thing?
Nic