Tom Schwaller wrote:


I seems strange that you have to add the directory "MiscUtils",
which I expected "to be there" by default.
Maybe a 'Cans' directive in Application.config would make
the configuration easier (the default "Can" directory could be
added there and not in the code:

def initializeCans(self):
@@ Overhaul by 0.4
import CanFactory
self._canFactory = CanFactory.CanFactory(self)

MiscUtils is in the standard import path by default.  However, in order to try to provide aome clean namespace, when you try to create a Can, it only looks in the directories in Application._canDirs.  This may be a useless attampt at keeping namespaces clean.  Or maybe I should just add MiscUtils to the list of directories that are already in the list.

 return {'ContentLocation':os.path.join(location,'Content'),}
The call to contextInitialize passes in the directory that you're in.  I 
have the Content directory right underneath here, so I just attach that
to the passed in parameter.

When I put Servlets in the Content directory, my classes (e.g.
in the Context-Directoy are not found?. ???

http://localhost/wpy/Context/ gives
("Context" is a Context added in Application.config)

File "/var/www/Webware/WebKit/Context/Content/", line 1, in ?
from DocPage import DocPage
ImportError: No module named DocPage

When I leave out
return {'ContentLocation':os.path.join(location,'Content'),}

and put my Servlets in the Context directory everything works ok.

If I understand what you are saying, this is the correct behavior.  The dictionary that you return from contextIntialize should contain the directory you want WebKit to look in for Servlets.  So if you designate "Context" as your top level directory, and then have a directory named "Content" below that, and you return "ContentLocation: "/path/to/Context/Content" in the dictionary you return from contextInitialize, then WebKit will only look in Context/Content for servlets.  It will not look in "Context", the top level directory.  You need to move all your your servlets and PSP pages down to Content.

In the last CVS version I have a strange problem though:

When I call


first and then


everything works, but calling


first (after restarting the AppServer) gives me an error. I call then


again and after that


works!! This is weird!

What is the error?