1.1 --- a/docs/JavaServlet/NOTES.txt Fri Jun 20 22:39:01 2008 +0200
1.2 +++ b/docs/JavaServlet/NOTES.txt Thu Sep 27 17:47:19 2007 +0000
1.3 @@ -1,25 +1,54 @@
1.4 -Preparing the Application
1.5 -=========================
1.6 +Jython and the Java API
1.7 +=======================
1.8 +
1.9 +For WebStack to function properly, the underlying Java API classes must be
1.10 +available. Although this seems like an obvious prerequisite, some
1.11 +distributions of Jython, notably the jython package provided with Ubuntu
1.12 +Feisty (7.04), do provide a version of Jython that runs, but do not provide
1.13 +the underlying class libraries for the Java APIs such as the java.net package.
1.14 +Consequently, WebStack will fail when importing modules such as urllib.
1.15
1.16 -Use the webstack_java_build.py script (installed by setup.py but also found in the
1.17 -tools/JavaServlet directory) to create a Web application directory. Then,
1.18 +The solution to such problems is to choose packages which provide the Java API
1.19 +functionality such as the jython-gcj package for Ubuntu Feisty (7.04).
1.20 +Alternatives include installing a full Java runtime environment and persuading
1.21 +Jython to run on that environment, or even to install a completely separate
1.22 +Jython from a different source such as jython.org.
1.23 +
1.24 +Preparing the Application for Deployment
1.25 +----------------------------------------
1.26 +
1.27 +Use the webstack_java_build.py script (installed by setup.py but also found in
1.28 +the tools/JavaServlet directory) to create a Web application directory. Then,
1.29 deploy the directory in the servlet container. For example:
1.30
1.31 jython webstack_java_build.py examples/JavaServlet/SimpleApp.py \
1.32 examples/Common/Simple/ \
1.33 . \
1.34 + /tmp/jython-cache \
1.35 web.xml \
1.36 $CATALINA_HOME/common/lib/activation.jar \
1.37 $CATALINA_HOME/common/lib/mail.jar
1.38
1.39 This identifies the handler (SimpleApp.py), the application package (Simple),
1.40 -the directory where the WebStack package is found (.), and the name of the
1.41 -template for the deployment descriptor (web.xml); it also specifies the
1.42 -library files which must also be deployed with the application (activation.jar
1.43 -and mail.jar from the Tomcat libraries in this case); it produces a directory
1.44 -called SimpleApp in the current directory. To deploy the Web application into
1.45 -a servlet container like Tomcat, a command like the following can be
1.46 -performed:
1.47 +the directory where the WebStack package is found (.), the directory to be
1.48 +used for caching imported classes, and the name of the template for the
1.49 +deployment descriptor (web.xml); it also specifies the library files which
1.50 +must also be deployed with the application (activation.jar and mail.jar from
1.51 +the Tomcat libraries in this case); it produces a directory called SimpleApp
1.52 +in the current directory.
1.53 +
1.54 +Important
1.55 +---------
1.56 +
1.57 +Note that the cache directory is a new setting from WebStack 1.2.6 which has
1.58 +been introduced to work with environments where the default class cache
1.59 +directory may, for some reason, be read-only.
1.60 +
1.61 +Deploying the Application
1.62 +-------------------------
1.63 +
1.64 +To deploy the Web application into a servlet container like Tomcat, a command
1.65 +like the following can be performed:
1.66
1.67 mv SimpleApp/ $CATALINA_HOME/webapps/
1.68