1.1 --- a/README.txt Fri Mar 26 17:47:34 2004 +0000
1.2 +++ b/README.txt Fri Mar 26 18:58:31 2004 +0000
1.3 @@ -39,28 +39,24 @@
1.4 Java Servlet API Notes
1.5 ----------------------
1.6
1.7 -Trying to get WebStack working on top of the Java Servlet API was an
1.8 -unsuccessful exercise. First, I tried to use jythonc at the top of a directory
1.9 -structure consisting of WebStack, Simple and the SimpleApp.py source file, but
1.10 -jythonc insisted on making a Java source file - WebStack.java - which
1.11 -conflicts with the WebStack package. I would have expected it to make an
1.12 -__init__.java file inside the WebStack directory containing the Java source
1.13 -files.
1.14 +Using JythonServlet:
1.15
1.16 -Then, I decided to make .jar files for each package before compiling
1.17 -SimpleApp.py, but this did not work particularly well. Each main.py file
1.18 -imports the appropriate package (WebStack.Adapters.JavaServlet for WebStack,
1.19 -Simple for Simple). The CLASSPATH environment variable was set to include
1.20 -servlet.jar from Apache Tomcat and, for SimpleApp.py, the previously produced
1.21 -.jar files.
1.22 +mkdir SimpleApp
1.23 +mkdir SimpleApp/WEB-INF
1.24 +mkdir SimpleApp/WEB-INF/classes
1.25 +mkdir SimpleApp/WEB-INF/jython
1.26 +mkdir SimpleApp/WEB-INF/lib
1.27 +cp ${JYTHON_HOME}/jython.jar SimpleApp/WEB-INF/lib
1.28 +cp -R ${WEBSTACK_HOME}/WebStack SimpleApp/WEB-INF/jython
1.29 +cp -R ${WEBSTACK_HOME}/examples/Common/Simple SimpleApp/WEB-INF/jython
1.30 +cp ${WEBSTACK_HOME}/examples/JavaServlet/SimpleApp.py SimpleApp
1.31 +cp ${WEBSTACK_HOME}/examples/JavaServlet/web.xml SimpleApp/WEB-INF
1.32 +mv SimpleApp ${CATALINA_HOME}/webapps
1.33
1.34 -[In the WebStack root directory...]
1.35 -jythonc --all --jar .../WEB-INF/lib/WebStack.jar -J "-deprecation" main.py
1.36 -[In the examples/Common directory...]
1.37 -jythonc --all --jar .../WEB-INF/lib/Simple.jar -J "-deprecation" main.py
1.38 -[In the examples/JavaServlet/SimpleApp directory...]
1.39 -jythonc --all --workdir .../WEB-INF/classes -J "-deprecation" SimpleApp.py
1.40 -cp .../jython.jar .../WEB-INF/lib
1.41 +Unfortunately, PyServlet doesn't manage to find various modules in packages:
1.42
1.43 -Somehow, the Simple package doesn't contain SimpleResource, even if the
1.44 -appropriate main.py file explicitly references it.
1.45 +javax.servlet.ServletException: Could not create Jython servletTraceback (innermost last):
1.46 + File "/data/home/paulb/Software/Java/jakarta-tomcat-4.1.27/webapps/SimpleApp/SimpleApp.py", line 3, in ?
1.47 +ImportError: cannot import name JavaServlet
1.48 +
1.49 +The same modules can be imported in interactive Jython.