qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qexo-general] XQuery as CGI scripts


From: Jun Yu
Subject: [Qexo-general] XQuery as CGI scripts
Date: Sun, 22 Feb 2004 00:31:51 +0100 (MET)

Hello everybody,
I have a few questions about "Installing XQuery as CGI scripts".

1. In the description "Installing Kawa programs as CGI scripts", there are
such steps:
(1)kawa --servlet --xquery -C hello.xql
(2)cp hello*.class /var/www/cgi-bin/
(3)find the cgi-servlet program that Kawa builds and installs.
(4)Copy this program into the same CGI directory:
     cp /usr/local/bin/cgi-servlet /var/www/cgi-bin/
(5)Run the Kawa program: http://localhost/cgi-bin/hello

my question is:
(1)The step(1) will get a group of class files like hello*.class , not
only a single hello.class ?
(2)Normally Java class files have to be executed through Java interpreter.
Why do not need it? The cgi-servlet program is Kawa's supplied
CGI-to-servlet bridge ? Does it function as Java interpreter? I did not
find more explanation
about it.
(3)Usually, executing a CGI program, we should use
"http://localhost/cgi-bin/hello.class";, but step(5) use
"http://localhost/cgi-bin/hello"; ?


2. Comparing "Running XQuery as CGI scripts" with "Running XQuery as
servlet".
It says, the former "may take a few seconds to get the reply, mainly
because of the start-up time of the Java VM. That is why servlets are 
preferred."
I have some thought, but I am not sure if it is right. The following is my
description:
----
A CGI program parse a client request through environment variables. Some
of these variables may change for each HTTP request. The web server starts a new
system process for each request. Thus the server must give the Java VM a new set
of environment variables for each client request. Both the Java VM and the
CGI program end this request and restart for next request.

The Java Servlets technology process each request with either doGet() or
doPost() method. Both of them read a client request from the object
"HttpServletRequest", and respond the client with the object
"HttpServletResponse". It avoids using environment variables.

That is why running XQuery programs as CGI takes more time than as
Servlets.
---

Thanks for any opinion.

Best regards,
Jun Yu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]