Using GNUJSP with W3C's Jigsaw web server ----------------------------------------- $Id: INSTALL.jigsaw,v 1.3 1999/10/17 01:37:24 wes Exp $ This procedure has been tested in the following environments: GNU Linux / Sun/Blackdown JDK 1.2pre2 / Jigsaw 2.0.3 GNU Linux / Sun/Blackdown JDK 1.2pre2 / Jigsaw 2.1.0 WinNT4 / Sun JDK 1.2.2 + Hotspot / Jigsaw 2.1.0 Jigsaw is an open-source, pure-Java web server developed by the W3 Consortium. Its design differs from most other web servers. This document assumes that you have a basic Jigsaw setup up and running (that is, you've run the install script and started the server to test that you can see the home page come up.) Jigsaw comes "out of the box" with servlet support and a default home directory for servlets ("/servlet"), but you'll need to tell it where to find the JSDK classes and GNUJSP. SETTING THE CLASSPATH First, you'll need to make the javax.servlet classes and the org.gjt.jsp classes available to Jigsaw. You can do this by adding JAR files to the CLASSPATH setting: *) gnujsp10.jar from the GNUJSP distribution *) servlet-2.1.jar from the GNUJSP distribution OR servlet.jar from JavaSoft's JSWDK-1.0 or elsewhere *) if you're using JDK 1.2, add tools.jar if you want to use the built-in java compiler (if you don't know what this means, add it anyway.) Edit the appropriate startup file for your platform (scripts/jigsaw.sh or scripts\jigsaw.bat) to make these changes, then restart Jigsaw. ADDING THE GNUJSP SERVLET Next, using the JigAdmin tool (scripts/jigadmin.sh or scripts\jigadmin.bat), create an entry for the GNUJSP JspServlet in the servlet directory. Click on the "http-server" puzzle piece. Right click on servlet (under "Root"). Select Add new resource. In the dialog box, choose class "org.w3c.jigsaw.servlet.ServletWrapper" and give it the name "gnujsp10" (or whatever you would prefer). Right click on the new icon for gnujsp10 and select edit resource. For servlet class, enter "org.gjt.jsp.JspServlet". Click on init parameters, and add an entry setting "scratchdir" to a temporary directory GNUJSP will use to generate servlets (e.g. "/tmp" or "D:\TEMP"). Click "Commit" and then close the resource window. MAPPING THE JSP EXTENSION Select the indexers tab in the main JigAdmin window. Open up "default", and then right click on "extensions". Select Add new resource. Choose class "org.w3c.tools.resources.FileResource", and enter the extension name you wish to use for the identifier (for example, "jsp"). Right click the new "jsp" icon, and select Edit resource. On the menu bar, choose Resource-->Add Frame to Selected... Choose class "org.w3c.jigsaw.servlet.ServletMapperFrame". Click on the ServletMapperFrame icon to bring up its property sheet. Set the "servlet-url" field to the URI where you put the GNUJSP servlet (in this example, "/servlet/gnujsp10"). Commit changes and close the resource window. Click "Save" in the main JigAdmin window. Drop a JSP file (for examples, "examples/snoop.jsp" from the GNUJSP install directory) into Jigsaw/Jigsaw/WWW, and try hitting it in the browser. If things are flaky, recheck your settings (sometimes the admin tool doesn't seem to save them correctly), or try stopping and starting the Jigsaw server. If you get this far and it doesn't work, send email to gnujsp@gjt.org and carefully explain the problem; hopefully someone can help resolve it. CAVEATS *) This procedure only works for Jigsaw 2.0.2 and up. *) I couldn't find ServletMapperFrame as an option in the drop-down list using the JDK 1.1 version of JigAdmin (JigAdm). I haven't actually tried this, but I think you can type it in manually. *) JigAdmin and JigAdm seem to be very flaky and crash-prone. Save early and save often if you have problems.