SISCweb Manual


Table of Contents

1. Introduction
Features
License
Credits
Contact Information
2. Installation
Requirements
Components
Configuration
Context Parameters
The Adapter Servlet
SISC Configuration Parameters
Environment Entries
REPL Entries
Logging Entries
Continuation Manager Entries
3. Generating content
Markup
(X)HTML Core Procedures
XML Core Procedures
Extended SXML
Extended HTML markup
Plain Text
Forwarding Requests
Files
Images
GraphViz Graphs
Graphviz Procedures
DotML
HTTP errors
4. Managing Program State
Introduction to Statefulness
State in Traditional Web Applications
Continuations and State
Finer Statefulness
State with SRFI-39 Parameter Objects
State with Web Cells
State with the Session Object
5. Publishing Procedures
Publishing Procedures
6. Request Bindings
Extracting Bindings
Extracting Bindings from Java
Bindings and Security
7. Interaction with SQL Databases
JDBC Functions
Running Queries
Database Vendor Support
HSQLDB
Microsoft SQL Server Support
Oracle
PostgreSQL
Adding Support for Other Vendors
8. Lower-level APIs
Request Procedures
Response Procedures
Session Procedures
ServletContext Procedures
A. GNU General Public License
Preamble
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
Section 0
Section 1
Section 2
Section 3
Section 4
Section 5
Section 6
Section 7
Section 8
Section 9
Section 10
NO WARRANTY Section 11
Section 12
How to Apply These Terms to Your New Programs
Index

List of Tables

2.1. REPL-related environment entries
2.2. Log-related environment entries
2.3. Continuation management environment entries

SISCweb is a framework to facilitate writing stateful Scheme web applications in J2EE environments.

SISCweb sports an interactive, REPL-based web application development style. Developers can write applications interactively, without ever restarting the context, and, insofar as it is desirable, without ever losing application state. (In fact, save for the Java portion, SISCweb itself is developed interactively in its own REPL.)

Through the use of continuations, SISCweb does away with the page-centric execution model typical of web applications (see [1].) Every time a response is sent to the browser, the program execution flow is suspended, to be then resumed from that exact point when the browser submits a request. Some consequences of this approach are:

  • Programs are more easily structured around their problem domain rather than their presentation.
  • Developers are mostly freed from having to manually manage the lifecycle of objects in the session. The need to to store objects in the session is greatly reduced because when the browser submits a request, and the program's execution flow is resumed, all the language-level variables that were in scope are again available.
  • Thanks to SISC's serializable continuations, accumulated program state is transparent to server restarts.
  • Programs can be made resilient to page reloads and browser window cloning with much less effort.
  • An extra security layer is added because URLs (which now encode a reference to program state) cannot easily be manipulated, hidden form variables are not needed anymore, and in general the automatic state management in SISCweb should be more difficult to hack than the ad-hoc solutions developers are forced to implement in traditional web frameworks.

Note

This document is a work-in-progress. Readers not familiar with other Scheme web frameworks might want to also read through the documentation of more mature implementations:

SISCweb is based on SISC (http://sisc.sourceforge.net/), a Scheme interpreter for the JVM with full continuations, and is heavily influenced by other Lisp web frameworks:

A couple of initial design decisions were also lifted from Matthias Radestock's servlet code in the contrib section of the SISC CVS tree.

Also special thanks to Anton van Straaten, Dominique Boucher, Ben Simon, Dan Muresan, Felix Klock and Tony Garnock-Jones for bug reports, suggestions, and/or work in support of SISCweb.



[1] Christian Queinnec. "Inverting back the inversion of control or, continuations versus page-centric programming". Technical Report 7, LIP6. May 2001. ( http://www-spi.lip6.fr/~queinnec/Papers/www.ps.gz )

Using SISCweb in web applications is simple matter of including its components in the classpath and making some entries in the web.xml deployment descriptor.

First-time users may want to check out the example WAR file (siscweb-examples-[v].war). It can be deployed by simply dropping it into the deployment folder of a J2EE appserver, and can also be used as the starting point for developing a new application.

Warning

While the server-side REPL is disabled in the SISCweb examples WAR file available from sourceforge.net, if you build it from sources, a REPL will be bound to the localhost:5156 socket. This is a security vulnerability. You should make sure to disable this feature if you are concerned about other people on the same host gaining access to a full-fledged REPL.

SISCweb requires a couple of context parameters and a listener in order to initialize. Besides that, the SISCAdapterServlet should be associated to the context path under which sisclets (SISC servlets) should be published.

Optionally, a number of environment entries are used to control various aspects of SISCweb's behavior and performance.

Beside SISCweb-specific settings, it is also possible to specify SISC parameters.

A Java adapter servlet allows the mapping of context paths to groups of sisclets. Sisclets are simply Scheme procedures associated through the publish mechanism (see Chapter 5, Publishing Procedures) to paths below that of the adapter servlet.

The adapter servlet accepts two parameters, on-init-sexp and on-destroy-sexp, which are invoked when the servlet is initialized and destroyed. As the example below shows, they are typically used to respectively publish and unpublish sisclets.

          
<servlet>
  <servlet-name>examples</servlet-name>
  <description>siscweb examples</description>
  <servlet-class>siscweb.web.SISCAdapterServlet</servlet-class>
  <init-param>
    <param-name>on-init-sexp</param-name>
    <param-value>
      <![CDATA[
        ;; NOTE: scm/ is not generally a good place, since it is browsable
        (class-path-extension-append! '("scm/" "WEB-INF/scm/"))

        (require-extension (lib siscweb/publish))
        (require-extension (lib examples/hello-world))

        (publish "/hello/*" 'hello-world)

      ;; replace round parentheses below with square ones in real life
      ))>
    </param-value>
  </init-param>
  <init-param>
    <param-name>on-destroy-sexp</param-name>
    <param-value>
      <![CDATA[
        (require-extension (lib siscweb/publish))

        (unpublish "/hello/*")
      ;; replace round parentheses with square in real life
      ))>
    </param-value>
  </init-param>
</servlet>

<servlet-mapping>
  <servlet-name>examples</servlet-name>
  <url-pattern>/sisclets/*</url-pattern>
</servlet-mapping>
          
        

Some aspects of SISCweb's inner workings can be controlled via a number of environment entries. The advantage of environment entries over Java properties or context parameters is that they can be usually changed through the application server's administrative console. This is especially useful because new values for a select environment entries are dynamically picked up within about one minute.

SISCweb stores and manages the lifecycle of the continuations corresponding to URLs through a pluggable class. This allows storing continuations in the Session object (recommended), databases, flat files, or user-defined storage.


SISCweb programs can generate HTTP responses of a variety of data types -- HTML/XML/XHTML represented in SXML notation, images --, or they can forward requests to standard JSPs/Servlet components. Procedures to generate HTTP errors are also available. Other response types can be easily plugged on top of a basic set of response procedures.

The procedures that produce HTTP responses are in the form send-*/*, with the first pattern indicating the type of response, and the latter determining whether or not to save the execution state, and whether or not to clear previously saved states.

All the procedures accept an optional association list of HTTP response headers as the first, optional argument. The association list is in the form ((name value) ...). This can be used to override the default Content-Type, to set caching options, etc.

SISCweb provides a number of modules with an uniform API to produce HTML, XHTML and XML markup. Their procedures accept documents in SXML syntax, and in the case of HTML and XHTML, a few extra elements and attributes are used to assist with continuation-based programming (see the section called “Extended HTML markup”.)

Requires: (import siscweb/html)
Requires: (import siscweb/xhtml)
Located in: siscweb-sxml.jar

The core procedures to send (X)HTML content follow the basic send-html/* and send-xhtml/* patterns. They differ in whether or not they clear the continuation table, and whether or not they return after the user interacts with the page.

Note

The XHTML and HTML modules serialize SXML differently, with the former producing pure XML, and the latter producing markup tweaked to display properly in known browsers. When producing XHTML for common user agents, it is advisable to keep the HTML Compatibility Guidelines in mind.

Also, while the XHTML module implements the complete SXML specification, the HTML module is more limited in that only understands DTD declarations, *VERBATIM* and *COMMENT* elements besides the basic element+attribute syntax. Also, while the XHTML module considers the *TOP* element functional, the HTML module silently ignores it.

The HTML and XHTML modules support a number of extra attributes to support continuation-centric programming and interaction with the J2EE environment.

attribute: `(object (@ (type "graphviz") (layout ,layout) (format ,format) ...) (graph (@ (id ,id) ...))

If the attribute type "graphviz" is specified for the object element, a Graphviz graph will be embedded in the document.

The layout and format attributes are analogous to the omonymous parameters to the send-graphviz/* functions (see the section called “Graphviz Procedures”.) However, the value of format determines how the content is included:

  • gif, jpg, png: The graph is embedded as an img tag, and a corresponding image map is generated. Links associated to nodes, edges and records will be mapped appropriately. Just as for other document elements, the @href[-[p|c|e]] and @bindings attributes are available, and behave as described in the section called “Extended HTML markup”.
  • ps, svg, etc.: The graph is embedded as an object tag. The appropriate mime type is automatically set, and needs not be specified explicitely.

In both cases, any attribute specified for the object tag will be applied toward the generated object or img tag.

(send-html/suspend
 (lambda (k-url)
  `(html
    (head
     (title "Embedded Graphviz")
    (body
    (h3 "Embedded Graphviz")

    (object (@ (type "graphviz")
               (layout dot) (format png))
      (graph (@ (id "G"))
        (node (@ (id "c") (label "scissors") (href "http://www.google.com/search?q=scissors")))
        (node (@ (id "p") (label "paper") (href "http://www.google.com/search?q=paper")))
        (node (@ (id "s") (label "stone") (href "http://www.google.com/search?q=stone")))
        (edge (@ (from "c") (to "p") (label "cut") (href-p ,cut)))
        (edge (@ (from "p") (to "s") (label "wraps") (href-c "/")))
        (edge (@ (from "s") (to "c") (label "breaks") (href-e ,k-url))))))))))
        

Requires: (import siscweb/forward)
Located in: siscweb.jar

Since SISCweb lives in a J2EE environment, it is sometimes convenient to generate content using traditional techniques such as JSPs and servlets rather than SXML.

The send-forward/* procedures dispatch the request to the indicated context-relative URL. Bindings can be attached in the form of <bindings> objects or a-lists. The forward/store! function can also be used to pass URLs mapped to closures in the style of the @[action|data|href|src]-p tags. Coupled with the URL corresponding to the current-continuation being set in the siscweb.kURL request attribute, this enables one to use SISCweb for control and JSP/Servlets for presentation without losing too many features.

See the section called “Extracting Bindings from Java” for details on how to access bindings from Java.

Requires: (import siscweb/graphviz)
Located in: siscweb-sxml.jar

This module provides procedures to send graphs in various formats as generated by Graphviz (http://www.graphviz.org). Most of the functions accept a markup representation of DOT, the GraphViz language, in the form of DotML (see the section called “DotML”.)

The GraphViz programs (dot, neato, etc.) should be installed somewhere in the system path. This is usually the case in UNIX. Alternatively, it is possible to set the absolute paths to the GraphViz programs by using the graphiz/put-layout-command! function.

Graphs can be generated either using the send-graphviz/* functions, or by embedding the @type="graphviz" attribute in the (X)HTML object tag (see the section called “Extended HTML markup”.)

Both send-graphviz/* procedures accept the same three parameters:

The send-graphviz/* procedures accept a graph description expressed in DotML. DotML was created by Martin Loetzsch, and an exhaustive description rich with excellent examples is at http://www.martin-loetzsch.de/DOTML.

SISCweb does not use code from the DotML project, but it implements the same markup syntax in sxml form. There are a few differences between SISCweb's implementation and the original:

  • The generated DOT code (which is then fed into GraphViz) is somewhat different.
  • The graph, sub-graph, cluster and node elements must always specify an id attribute.
  • The id attribute values at the moment are limited to strings of alphanumeric characters and underscore.
  • The enclosing record elements must specify an id attribute, but nested record and node elements do not have to.

Introductions to web programming often mention the statelessness of the HTTP protocol, to then describe how cookies and sessions solve the problem. This is not a complete solution however: being "sessionful" is not the same as being "stateful."

Cookies and sessions are mechanisms laid on top of the HTTP protocol respectively to: a) allow an application to recognize two requests coming from the same browser as such, and b) to store data common to such requests.

Neither cookies nor sessions completely address the issue of statelesness because, while programs have the means to associate two requests to a given user (as they contain the same cookie), they have no means by which to associate two requests as being part of the same navigation flow. It is in fact possible to manually place requests out of sync with program state, and often trigger incorrect behavior. Traditional web applications are thus less like a program with a GUI interface and more like an API open to the world. Forced browsing, or even using the back button, can cause an application to misbehave in ways that are not easily foreseeable as application complexity increases.

Aside from state, the Session object is common to all requests from the same browser, so simply using a web application from two windows can produce concurrency problems such as loss of consistency or race conditions. Moreover, since the session is a global scope for the application, in fact the only scope that traditionally persists from request to request, developers are unable to take advantage of the finer scoping mechanisms available in modern programming languages.

One last major issue with traditional web applications is that they are made of short-lived code snippets which, after parsing the request in the context of the session, generate a response and exit. Because their state is lost, it is impossible to use structured programming techniques in code spanning multiple requests. Even the simplest for-loop must be expressed in terms of a (global) session variable increment and a GOTO (HREF).

Requires: (import srfi-39)

A complete treatment of parameters is available in SRFI-39. This section is concerned with the use of the dynamic environment to maintain state shared by all requests for the same user in the same execution flow.

SRFI-39 parameters are essentially dynamically-scoped variables. They can be defined in the global or the module scope and then bound to the dynamic scope -- the scope of the execution flow -- in the application entry point through the parameterize form.

When using send-*/[suspend|forward], the parameters, being part of the dynamic environment, are captured in the suspended state -- the suspension of the program execution is transparent to parameter bindings.

However procedures stored with @href-p-style attributes or the forward/store! procedure will run in the base dynamic environment, and thus will see fresh values of the parameters. In those cases on can use forward/dynenv/store!, which instead preserves the dynamic environment.

The Counter with SRFI-39 Parameters example demonstrates this technique.

Requires: (import siscweb/webcells)

Web Cells are a way to track program state according to the navigation flow. They are described in full in the paper Interaction-Safe State for the Web.

In essence, cells establish a dynamic scope over the navigation path of a user. Successive pages can overshadow values of bindings set in previous pages, but do not destroy them.

If a user backtracks the browser window, previous values are again visible. If the user clones the window and proceeds through two different navigation branches, each branch sees the values it overshadows.

The Counter with Webcells example demonstrates this technique.

Procedures can be published to virtual paths of an application server within the hierarchy of a siscweb application. Publishing can be done both interactively at the server-side REPL during development, and in the web.xml file at deployment time. (See the section called “The Adapter Servlet”.)

Requires: (import siscweb/publish)
Located in: siscweb.jar

This module provides simple procedures to publish procedures to URL patterns. Patterns can be expressed either as wildcards or regular expressions.

Published procedures accept a single parameter in the form of a request object.

Wildcard patterns can use wildcards and double-wildcards between slashes, such as in "/hello/*" or "/hello/**/world". The first pattern matches requests such as "/hello/there", "/hello/", or even "/hello"; the second pattern matches "/hello/world" as well as "hello/what/a/wonderful/world/".

Bindings associated with the request returned by the send-*/(suspend|forward) functions, or passed as parameters to procedures that are either published or the target of a dispatch, can be extracted and associated to language-level variables.

Bindings, as returned by the function get-bindings are contained in an opaque object. This object can be converted to an association list via bindings->alist, or queried in constant time using the extract-bindings or extract-single-binding functions. The object is guaranteed to be serializable, but code should not rely on its specific implementation.

Requires: (import siscweb/bindings)
Located in: siscweb.jar

This module assists developers in obtaining values of parameters passed in a request.

Bindings specified in the send-forward/* functions are assigned to request attributes. This method supercedes the previous request.getBinding*() API, which is now deprecated and will be removed in the next release.

Multi-valued bindings, as in '((messages "hello" "there")), are turned into a java.util.List and can be easily scanned using such tools as JSTL's <c:forEach>. Single-valued bindings, such as '((message . "hello")) are simply assigned to the attribute.

Multi-valued bindings originating from a Scheme list are also marked as such, so that they can be converted back to a list of values rather than to an object of type java.util.List.

A minimal amount of type conversion is performed. Scheme values are passed as SISC objects, except for Scheme strings, which are converted to Java strings. Java objects are left untouched. This also applies to the individual values of multi-valued bindings.

For instance, below is the Polyglot Hello World example using JSP/JSTL as the presentation layer. This example is not included in the distribution because of its external dependencies on the JSTL libraries.

        
;; file: hello.scm
(require-library 'siscweb/forward)

(module examples/hello-world
  (hello-world)

  (import siscweb/forward)

  (define messages '("Hello, world!" "Salve, mundo!" "Hallo, Welt!" "Salve, mondo!" "Bonjour, monde!" "Hola, mundo!"))

  (define (hello-world req)
    (let loop ()
      (for-each
       (lambda (message)
         (send-forward/suspend "/jsp/hello.jsp" `((message . ,message))))
       messages)
      (loop)))
  )


<%-- File: jsp/hello.jsp
--%><%@ page contentType="text/html" %><%--
--%><%@ page isELIgnored="false" %><%-- just for servlet v2.3 containers
--%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><%--
--%><%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%><%--
--%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%><%--
--%><%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%><%--
--%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%><%--
--%><?xml version="1.0"?>

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title><c:out value="${requestScope.message}"/></title>

    <c:url var="cssUrl" value="/css/default.css"/>
    <link href="${cssUrl}"
          rel="stylesheet"
          type="text/css"/>
  </head>

  <body>
      <h3>Polyglot hello world</h3>
      <p>${requestScope.message}</p>

    <p><a href="${requestScope["siscweb.kURL"]}">Next language &gt;</a></p>
    <p><a href="${requestScope["siscweb.kURL"]}" target="_blank">Next language in new window</a></p>
    <c:url var="homeUrl" value="/"/>
    <p><a href="${homeUrl}">^ Home</a></p>
  </body>
</html>
        
      

The SQL library performs automatic conversion between scheme and database types. Since the exact conversion table depends on the vendor, a mechanism is provided to add support for other vendors though vendor-specific modules.

Note

This library is not yet complete, but it covers the most frequently used functionalities. It should be considered useful but immature; in particular, a few names and function signatures are subject to change.

Requires: (import sql/jdbc)
Located in: siscweb-sql.jar

This module provides functions to load drivers, obtain connections, and execute procedures within a transactional context.

Requires: (import sql/query)
Located in: siscweb-sql.jar

This module provides functions to execute queries and map through result sets.

Note

JDBC ResultSets are translated to lazy lists (in the sense of srfi-45) of SISC hashtables. When the last element of the list is fetched (or in case of error during fetching), the underlying JDBC ResultSet and Statement are automatically closed. In case of premature escape from the jdbc/call/conn context, intentional or not, the JDBC ResultSet and Statement are closed only upon garbage collection. This can be a particularly insidious problem when using pooled connections, and will be fixed in the future.

procedure: (sql/execute connection sql-query [value] ...) => number/resultset

Executes sql-query through the given connection.

A number of optional values can be specified; these will be bound in order to the placeholders in the query. Date, time and timestamps from srfi-19 can be used to bind to SQL DATE, TIME and TIMESTAMP types.

Returns the number of rows updated in case of an INSERT/UPDATE/DELETE query statement, and a result set in case of a SELECT statement. Result sets are lazy lists in the sense of srfi-45. Each element of the list is a hashtable (field-name => value). Multiple result sets are not supported.

          
(sql/execute conn "SELECT * FROM my_table WHERE id = ?" 12345)
            
        

SISCweb includes a number of vendor-specific modules that map Scheme data types onto SQL types and provide extra functionalities, usually in the area of BLOB handling.

Adding support for new vendors is described in the section called “Adding Support for Other Vendors”

Even though SISCweb applies an abstraction layer over characteristics of the HTTP protocol, it is still at times convenient to access the details of requests, responses, sessions and the servlet context in which they live.

For this reason SISCweb provides wrappers around all the methods of the Request, Response, Session and ServletContextobjects. All the procedures operate on the instances current at the time of invocation.

Requires: (import siscweb/request)
Located in: siscweb.jar

This module provides wrappers around the Request object current at the time of invocation.

Requires: (import siscweb/response)
Located in: siscweb.jar

This module provides wrappers around the Response object current at the time of invocation.

Requires: (import siscweb/session)
Located in: siscweb.jar

This module provides wrappers around the Response object current at the time of invocation.

Requires: (import siscweb/context)
Located in: siscweb.jar

This module provides wrappers around the ServletContext object.

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software - to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

We protect your rights with two steps:

Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and modification follow.

You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

  1. You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

  2. You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.

  3. If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.

    Exception:

    If the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

You may copy and distribute the Program (or a work based on it, under Section 2 in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

  1. Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

  2. Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

  3. Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice

This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.

B

bindings->alist, Extracting Bindings

C

context/get, ServletContext Procedures
context/get-dispatcher, ServletContext Procedures
context/get-init-parameter, ServletContext Procedures
context/get-init-parameter-alist, ServletContext Procedures
context/get-init-parameter-hashtable, ServletContext Procedures
context/get-java-attribute, ServletContext Procedures
context/get-java-attribute-names, ServletContext Procedures
context/get-major-version, ServletContext Procedures
context/get-mime-type, ServletContext Procedures
context/get-minor-version, ServletContext Procedures
context/get-name, ServletContext Procedures
context/get-named-dispatcher, ServletContext Procedures
context/get-real-path, ServletContext Procedures
context/get-resource, ServletContext Procedures
context/get-resource-paths, ServletContext Procedures
context/make-parameter, ServletContext Procedures
context/open-resource-binary-input-port, ServletContext Procedures
context/remove-java-attribute!, ServletContext Procedures
context/set-java-attribute!, ServletContext Procedures
current-context, ServletContext Procedures
current-request, Request Procedures
current-response, Response Procedures
current-session, Session Procedures

E

exists-binding?, Extracting Bindings
extract-bindings, Extracting Bindings
extract-single-binding, Extracting Bindings

F

forward/store!, Forwarding Requests

G

get-all-published, Publishing Procedures
get-bindings, Extracting Bindings
get-published, Publishing Procedures
graphviz/get-layout-command, Graphviz Procedures
graphviz/put-layout-command!, Graphviz Procedures

J

jdbc/call/conn, JDBC Functions
jdbc/call/tran, JDBC Functions
jdbc/call-with-connection, JDBC Functions
jdbc/call-with-transaction, JDBC Functions
jdbc/close-connection, JDBC Functions
jdbc/get-connection, JDBC Functions
jdbc/get-vendor, JDBC Functions
jdbc/load-driver, JDBC Functions
jdbc/open-connection, JDBC Functions

L

let-bindings, Extracting Bindings

O

oracle/read-blob, Oracle
oracle/write-blob, Oracle

P

publish, Publishing Procedures
publish/regexp, Publishing Procedures
publish/wildcard, Publishing Procedures
publish-bulk, Publishing Procedures

R

request/get-auth-type, Request Procedures
request/get-character-encoding, Request Procedures
request/get-content-length, Request Procedures
request/get-content-type, Request Procedures
request/get-cookies, Request Procedures
request/get-date-header, Request Procedures
request/get-dispatcher, Request Procedures
request/get-header, Request Procedures
request/get-header-alist, Request Procedures
request/get-header-hashtable, Request Procedures
request/get-header-names, Request Procedures
request/get-init-parameter-names, ServletContext Procedures
request/get-int-header, Request Procedures
request/get-java-attribute, Request Procedures
request/get-java-attribute-names, Request Procedures
request/get-locale, Request Procedures
request/get-locales, Request Procedures
request/get-method, Request Procedures
request/get-parameter, Request Procedures
request/get-parameter-alist, Request Procedures
request/get-parameter-hashtable, Request Procedures
request/get-parameter-names, Request Procedures
request/get-parameter-values, Request Procedures
request/get-path-info, Request Procedures
request/get-path-translated, Request Procedures
request/get-protocol, Request Procedures
request/get-query-string, Request Procedures
request/get-remote-addr, Request Procedures
request/get-remote-host, Request Procedures
request/get-remote-user, Request Procedures
request/get-requested-session-id, Request Procedures
request/get-scheme, Request Procedures
request/get-server-name, Request Procedures
request/get-server-port, Request Procedures
request/get-servlet-path, Request Procedures
request/get-session, Request Procedures
request/get-uri, Request Procedures
request/get-url, Request Procedures
request/get-user-principal, Request Procedures
request/open-binary-input-port, Request Procedures
request/open-input-port, Request Procedures
request/remove-java-attribute!, Request Procedures
request/requested-session-id-valid?, Request Procedures
request/secure?, Request Procedures
request/send-error, Response Procedures
request/send-redirect, Response Procedures
request/session-id-from-cookie?, Request Procedures
request/session-id-from-url?, Request Procedures
request/set-buffer-size!, Response Procedures
request/set-character-encoding!, Request Procedures
request/set-content-length!, Response Procedures
request/set-content-type!, Response Procedures
request/set-java-attribute!, Request Procedures
request/user-in-role?, Request Procedures
response/add-cookie!, Response Procedures
response/add-header!, Response Procedures
response/add-headers!, Response Procedures
response/commit!, Response Procedures
response/committed?, Response Procedures
response/contains-header?, Response Procedures
response/encode-redirect-url, Response Procedures
response/encode-url, Response Procedures
response/get-buffer-size, Response Procedures
response/get-character-encoding, Response Procedures
response/get-locale, Response Procedures
response/open-binary-output-port, Response Procedures
response/open-output-port, Response Procedures
response/reset!, Response Procedures
response/reset-buffer!, Response Procedures
response/set-header!, Response Procedures
response/set-locale!, Response Procedures
response/set-status!, Response Procedures

S

send-error/back, HTTP errors
send-error/finish, HTTP errors
send-file/back, Files
send-file/finish, Files
send-file-range/back, Files
send-file-range/finish, Files
send-forward/back, Forwarding Requests
send-forward/finish, Forwarding Requests
send-forward/forward, Forwarding Requests
send-forward/suspend, Forwarding Requests
send-graphviz/back, Graphviz Procedures
send-graphviz/finish, Graphviz Procedures
send-html/back, (X)HTML Core Procedures
send-html/finish, (X)HTML Core Procedures
send-html/forward, (X)HTML Core Procedures
send-html/suspend, (X)HTML Core Procedures
send-image/back, Images
send-image/finish, Images
send-image-file/back, Images
send-image-file/finish, Images
send-text/back, Plain Text
send-text/finish, Plain Text
send-text/forward, Plain Text
send-text/suspend, Plain Text
send-xhtml/back, (X)HTML Core Procedures
send-xhtml/finish, (X)HTML Core Procedures
send-xhtml/forward, (X)HTML Core Procedures
send-xhtml/suspend, (X)HTML Core Procedures
send-xml/back, XML Core Procedures
send-xml/finish, XML Core Procedures
send-xml/forward, XML Core Procedures
send-xml/suspend, XML Core Procedures
session/get-creation-time, Session Procedures
session/get-id, Session Procedures
session/get-java-attribute, State with the Session Object, Session Procedures
session/get-java-attribute-names, Session Procedures
session/get-last-accessed-time, Session Procedures
session/get-max-inactive-interval, Session Procedures
session/get-servlet-context, Session Procedures
session/invalidate!, Session Procedures
session/make-parameter, State with the Session Object, Session Procedures
session/new?, Session Procedures
session/remove-java-attribute!, Session Procedures
session/set-java-attribute!, Session Procedures
session/set-max-inactive-interval!, Session Procedures
sql/execute, Running Queries
sql/execute-query, Running Queries
sql/execute-update, Running Queries
sql/for-each-row, Running Queries
sql/map-row, Running Queries

W

webcell/make, State with Web Cells
webcell/make-parameter, State with Web Cells
webcell/ref, State with Web Cells
webcell/set!, State with Web Cells