Tom Schwaller wrote:

app.addCanDir('path/to/Webware/MiscUtils')

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 Application.py code:

def initializeCans(self):
"""
@@ Overhaul by 0.4
"""
import CanFactory
self._canDirs.append("Cans")
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.
DocPage.py)
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/index.py", 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

http://localhost/wpy/Context/

first and then

http://localhost/wpy/Context/Test/

everything works, but calling

http://localhost/wpy/Context/Test

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

http://localhost/wpy/Context/

again and after that

http://localhost/wpy/Context/Test

works!! This is weird!

What is the error?




Jay