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?

Karl,
the concept comes from the Java Servlet API.  In Java appservers, a 'servlet 
context' is a collection of config settings, servlets, session data, shared 
data, and a virtual directory that together constitute a self-contained 'web 
application'.  In Webware, 'context' is just a fancy name for virtual 
directory.  Unlike Java appservers, Webware's session data is global to all 
'contexts' and 'contexts' aren't first-class objects.  Hopefully, this will 
change in the future.

The Oracle Servlet Engine (OSE) has some excellent documentation that explains 
this Java approach:
http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/a90213/architecture.htm#1075985

Here's some example URIs from Webware:

http://myhost.com/context1/servletName.py
http://myhost.com/context1/subDir/servletName.py
http://myhost.com/myOtherContext/servletName.py  # different file from above
http://myhost.com/myOtherContext/subDir/servletName.py

context1 maps to the servlets found in /home/www_myhost_com/context1Servlets

myOtherContext maps to the servlets found in 
/home/www_myhost_com/otherServlets

> 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 servlets 
in your context in the __init__.py module.  However, there's usually a better 
way to do that sort of stuff.

> How do you use contexts?
Treat them just like virtual directories in IIS.

Cheers,
Tavis


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to