Apache JSSI

Version 1.1.2

Installation instructions

These are part of the installation instructions that come with the README/INSTALL files with the distribution.

Requirements

Installation

Compiling

You need to have the Java Servlet API (JSDK) 2.0 in your CLASSPATH to compile Apache JSSI. Please get this from: http://java.sun.com/products/servlet/

To compile the source code, go to the src/java directory and type:

     $ make
you'll get ApacheJSSI.jar

If you grabbed the distribution, the ApacheJSSI.jar is already compiled for you.

Installing

Apache JServ

In order to include the Apache JSSI classes in your servlet engine, you have to enable the server side inclusion by mapping the ".jhtml" URI to the "org.apache.servlet.ssi.SSI" servlet by doing the following:

In your Apache config file add:

         ApJServAction .jhtml /servlets/org.apache.servlet.ssi.SSI
Change the /servlets/ part to be the location of your zone. In your zone.properties file add the ApacheJSSI.jar to your repository:
         repositories=/path/to/ApacheJSSI.jar
Change the /path/to/ part to be the path to the location of your ApacheJSSI.jar file.

If you would like to use the URL-Rewriting feature, use the org.apache.servlet.ssi.ParameterPropagatingSSI - Servlet instead. Consult the documentation for further information.

Other Servlet Engines

Apache JSSI will work with other servlet engines that meet the requirements defined above. Please see the Apache JServ installation instructions for hints on how to configure your servlet engine in order to do suffix/action mapping.

Servlet Parameters

The SSI Servlet understands some optional parameters which can be given in the init Arguments:

With Apache JServ, you just have to insert a line in your zone.properties file go apply these parameters:
Example:
       servlet.org.apache.servlet.ssi.SSI.initArgs=SSISiteRoot=/site/root,expires=-1000

Usage

Servlet output may be included in an HTML document by use of the tag. For example, to embed the output of the HelloWorldServlet servlet in an HTML page, you might write the following:

        ... (some HTML code) ...
        <SERVLET CODE="HelloWorldServlet.class">
        Your web server has not been configured to support servlet tags.
        </SERVLET>
        ... (more HTML code) ...

When this page is served from the web server, the code above will be replaced with the output of HelloWorldServlet. If you see the message between the tags instead, there is a problem with your server configuration. If this happens, check to make sure your file has a ".jhtml" extension and that the server is properly configured.

Two attributes are used by the <SERVLET> tag, and they are roughly equivalent:

In some implementations of <SERVLET> tags, if both NAME and CODE attributes are set, the servlet designated by CODE will then become available for future use under the symbolic named designated by the NAME attribute. This is not currently supported.

Note that both the <SERVLET> and </SERVLET> tags must be present.

You may send parameters to a servlet via the PARAM tag, which should be placed between the <SERVLET> and </SERVLET> tags, like so:

        <SERVLET CODE="MyServlet.class">
         <PARAM NAME="param1" VALUE="valueOfParam1">
         <PARAM NAME="anotherParam" VALUE="valueOfAnotherParam">
        </SERVLET>

You could then access these parameters from your servlet as follows:

        public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {
            String param1 = req.getParameter("param1");
            String anotherParam = req.getParameter("anotherParam");
        }              
For use of the URL rewriting and traditional SSI features please follow the links.

Copyright (c) 1997-99 The Java Apache Project.
All rights reserved.