From: Karl Putland <karl@pu...> - 2002-05-02 16:34:56
So these may sound like a dumb questions,
but I haven't quite figured it out yet.
What is the point of contexts?
There is an __init__.py in the context directory.
What useful stuff can be put in there?
How do you use contexts?
On May 2, 2002 09:33 am, Karl Putland wrote:
> So these may sound like a dumb questions,
> but I haven't quite figured it out yet.
> What is the point of contexts?
the concept comes from the Java Servlet API. In Java appservers, a 'serv=
context' is a collection of config settings, servlets, session data, shar=
data, and a virtual directory that together constitute a self-contained '=
application'. In Webware, 'context' is just a fancy name for virtual=20
directory. Unlike Java appservers, Webware's session data is global to a=
'contexts' and 'contexts' aren't first-class objects. Hopefully, this wi=
change in the future.
The Oracle Servlet Engine (OSE) has some excellent documentation that exp=
this Java approach:
Here's some example URIs from Webware:
http://myhost.com/context1/servletName.pyhttp://myhost.com/context1/subDir/servletName.pyhttp://myhost.com/myOtherContext/servletName.py # different file from ab=
context1 maps to the servlets found in /home/www_myhost_com/context1Servl=
myOtherContext maps to the servlets found in=20
> There is an __init__.py in the context directory.
> What useful stuff can be put in there?
If needed, you can put any run-once-at-startup code specific to the servl=
in your context in the __init__.py module. However, there's usually a be=
way to do that sort of stuff.
> How do you use contexts?
Treat them just like virtual directories in IIS.