From: <bc...@wo...> - 2001-02-16 18:13:46
|
[Jaroslav Gergic] >> >Thak you for the tip! I will optionally upgrade - >> >> The change that brian describe is in org.python.util.PyServlet. Since >> you can't possible be using this class (because it is completely new) >> you will not find any benefits by upgrading. Unless you also begin to >> use org.python.util.PyServlet. > >Yes, I checked CVS and PyServlet seems also interesting >to me. I downloaded and compiled it but I can not >make it working I am constantly getting: > >[error] >---sample--- >from javax.servlet.http import HttpServlet Yes, this line was missing from the example in the PyServlet.java source. >class hello(HttpServlet): >... >---end--- > >I get: >javax.servlet.ServletException: No callable (class or function) named >hw in D:\develo\tomcat3.2b6\webapps\hello\hw.py > >(the script should probably evaluate to a single node...?) The .py servlet class must have the same name as the python source. The source must be called hello.py for the example to work. >*** >I is interesting for me, because my application (python based >templates in Java + Tomcat) >works normally using the CLASSPATH trick described earlier. >I think there is some subtle difference between my CLASSPATH >handling and PyServlet classpath handling. >Can something be wrong with the following lines?: >---from PyServlet--- > PySystemState sys = Py.getSystemState(); > sys.add_package("javax.servlet"); > sys.add_package("javax.servlet.http"); > sys.add_package("javax.servlet.jsp"); > sys.add_package("javax.servlet.jsp.tagext"); >---end--- This is needed because servlet.jar isn't available on the classpath when used with tomcat. Without these lines, import javax.servlet would not work. regards, finn |