From: Jaroslav G. <j_g...@ya...> - 2001-02-16 16:46:33
|
> >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: javax.servlet.ServletException: Could not create Jython servletTraceback (innermost last): File "D:\develo\tomcat3.2b6\webapps\hello\hw.py", line 1, in ? NameError: javax (I am testing Hello World servlet distributed with PyServlet:) ---sample--- class hello(HttpServlet): def doGet(self,req, res): res.setContentType("text/html"); out = res.getOutputStream() print >>out, "<html>" print >>out, "<head><title>Hello World, How are we?</title></head>" print >>out, "<body>Hello World, how are we?" print >>out, "</body>" print >>out, "</html>" out.close() return ---end--- It also does not work even when I try to write "class hello(javax.servet.http.HttpServlet)" and in case I try to import the interface: ---sample--- from javax.servlet.http import HttpServlet 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...?) *** 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--- Anyway - PyServlet is good idea, I planned to write something similar myself in the future, and PyServlet saves me some time. I hope I will get this thing working soon too. Regards Gergic BTW: I consider Jython based servlets much more flexible than JSPs... ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |