GnuJSP is a free implementation of Sun's Java Server Pages. Once the GnuJSP servlet is correctly installed, files with the extension .jsp are translated into java source files, compiled, and ran. This is an early release, intended for the adventurous. The JSP specification hasn't been fixed yet, and GnuJSP documentation is scarce, but you should be able to experiment with this exciting new technology!
GnuJSP has been tested with the following servlet engine/web server/JDK/OS combinations:
I would like know about other succesful combinations. Once more servlet engine/web server/OS platform combinations have been tested (and more time has been spent on writing the documentation), I want to have nice step-by-step installation guides here. For now, I will describe the general idea:
Please note that you need JDK1.1 (or higher) to run GnuJSP. JRE will not suffice, because Sun's java compiler is called directly. Future versions may change this.
If installation was succesful, a file with the extension .jsp should be handled by the JSP servlet and ran. Copy the JSP examples in the directory examples to your web directory and try loading snoop.jsp.
If parts of your site are secured by a .htaccess file or a similar construction and your /servlet/ directory is not, clients requesting /secure/file.jsp will be asked for authentication, while clients requesting /servlet/jsp/secure/file.jsp will not. Depending on your servlet engine, both requests are handled equally by the JSP servlet. This is a security problem also present with CGI programs. GnuJSP provides a rough work-around for this problem. If the checkuri=true is added to the JSP servlet's init arguments, any request that has /servlet/ or /jsp/ in the URI, are denied.
If the extension of a file handed to GnuJSP is not ".jsp", GnuJSP refuses to handle it. The extension can be changed by adding extension=<ext> to the JSP servlet's init arguments.
GnuJSP conforms to the JSP draft specification that used to be available at http://developer.javasoft.com/developer/earlyAccess/jspages/jsp_spec.htm. This draft is nearly identical to the JSP implementation in the JavaServer Pages preview pack, apart from the class and serializedfile attributes to the <BEAN> tag. GnuJSP follows the draft specification and calls these attributes type and beanName. The additions to the Servlet API (HttpServletRequest.setAttribute() and HttpServletResponse.callPage()) are not implemented by GnuJSP.
Awaiting the definitive JSP specification, GnuJSP adds a feature that is very useful to the JSP developer; file inclusion. Both the SSI and the JRun syntaxes are supported:
The GnuJSP toolkit is still being developed and a lot of documentation still has to be written, so it will not be released yet. Because one of the example JSP pages uses it, the MailBean has been released now. MailBean is a simple bean that can send email messages from JSP pages. Javadoc documentation is included.
GnuJSP automatically detects changes to a JSP file (and the JSP files it includes), and recompiles the JSP file if necessary. When a change (or a new file) is detected, the JSP file is translated to a Java file, and javac is run. If javac reports any errors, GnuJSP does its best to translate the Java line numbers to JSP line numbers and reports the errors in the browser window.
I'm very interested to hear what people think about GnuJSP and I'd like to hear about any problems you may be having with it, or suggestions you might have. Please email me at vinny@nmg.nl and check the webpage at http://www.nmg.nl/~vinny/gnujsp/ for the latest version.
Version 0.9.3 (15 Sep 1998):
Version 0.9.2 (12 Sep 1998):
Version 0.9.1 (5 Sep 1998):
Version 0.9.0 (27 Aug 1998):
This software is distributed under the terms of the GNU Public License. Please see the file COPYING included with the distribution for details.