|
From: <bc...@wo...> - 2001-02-12 21:38:12
|
On Mon, 12 Feb 2001 12:08:30 -0800, you wrote:
>These classes are accessible from java servlet and JSP pages, but not
>from jython servlet. The workaround would be to include those in
>CLASSPATH of tomcat startup script, but... you know.
I have not yet look at this in depth, but I think the classes from lib &
classes are available as classes, but not as jython package namespaces.
You can test this by trying to load a class from withon the .py file
with java.lang.Class.forName(). I guess this should work, but the normal
jython import does not work.
As a temporary workaround you can add the java packages to the jython
package manager yourself with add_package.
sys.add_package("testpackage")
from testpackage import TestClass
>Anyway, enough complains.
>
>I take a brief look at tomcat 3.2 source code at
>
> :pserver:an...@ja...:/home/cvspublic/jakarta-tomcat
> /src/share/org/apache/tomcat
>
>context/LoaderInterceptor.java seems to be where it adds WEB-INF/classes
>and WEB-INF/lib/*.jar to the classloader class repositories.
>
>Can we do similar things in PyServlet.java ?
It should be possible to force the jython package manager to search
these two wellknown places for java classes and packages. Perhaps by
setting python.packages.paths and python.packages.directories. Perhaps
by calling the package manager directly. More on later.
regards,
finn
|