Installing Kawa programs as Servlets

You can compile a Kawa program to a Servlet, and run it in a servlet engine (a Servlet-aware web server). I assume you have compiled your program to a servlet as descrbibed in the previous section.

If you have Tomcat 4.x installed, and you want hello to be part of the myutils "web application", copy hello*.class into $CATALINA_HOME/webapps/myutils/WEB-INF/classes/. You also need to copy Kawa somewhere where Tomcat can find it, for example $CATALINA_HOME/lib/kawa-1.9.1.jar. You can then run the hello servlet using the URL http://localhost:8080/myutils/servlet/hello.

Function: current-servlet

When called from a Kawa servlet's handler, returns the actual javax.servlet.http.HttpServlet instance.

Function: current-servlet-context

Returns the ServletContext of the currently executing servlet.

Function: current-servlet-config

Returns the ServletConfig of the currently executing servlet.

Function: servlet-context-realpath

Returns the file path of the current servlet's "Web application".