On Jan 29, 2005, at 3:29 PM, lloyd wrote:
1) is there a facility for running code on server start-up, and storing application-wide data (eg, say, a database connection pool manager)?
I don't know, but what I do is have my page base class create some singletons when first instantiated. That is, all pages in my website inherit from SitePage. The SitePage.__init__() creates my DB store on the first call only.
2) in a java servlet container like tomcat, each context is analagous to a separate application. in webware, this separation doesn't seem to exist. each context appears to be, basically, just a mapping of a URL segment to a directory. should i run a separate application server instance for each application that needs "separation" from other applications?
I think the answer is No. But I'm curious what kind of separation would you like? I haven't used Tomcat and I am thinking about if contexts should be removed from Webware since it doesn't do anything useful at the moment. Is there something good about contexts in Tomcat that we should build up?
3) are there examples or documentation for using webware, formkit, and cheetah together in an optimal way?
FormKit I would say is pretty straight forward. Cheetah is a problem though, because as Sam Nilsson mentioned, Cheetah.Template does not work well with WebKit.Page. The issue is that Cheetah.Template tries to inherit from WebKit.Servlet if it exists in the sys.path. The inheritence of WebKit.Page is: WebKit.Page > WebKit.HTTPContent > WebKit.HTTPServlet > WebKit.Servlet. So Cheetah.Template inherits from lower on the tree than WebKit.Page, but there are some functions like callMethodOfServlet() that are handy in WebKit.Page that you lose when your CheetahTemplate is a servlet. Sam Nilsson's way around this is to have his Page object just use Cheetah.Template objects. I.e. his page "has a" template instead of "is a" template. My solution was to remove the hack in Cheetah.Template that conditionally inherits from WebKit.Servlet. Yuck.
Another thing you will encounter using Cheetah is how to compile them. Since there is not a standard way to use them, I don't want to put my way into the Webware repository. I have two utilities that I use. One is a CheetahServletFactory that will load .tmpl files and compile them when requested. That only compiles templates that are referenced as pages though. If your template inherits from another template, then the second one is never called directly and is never recompiled. So for that case, I have a second utility that that searches for new .tmpl files every 3 seconds, and compiles them. I only start it when I am developing.
4) if one is using cheetah, are the separate writeXXX() methods in a servlet really useful, considering that most of that information may be in the templates?
Not really. You can use WebKit.HTTPContent which is one level below WebKit.Page, and it doesn't have all those convenience methods that you won't use.
-winston
_________________________________________
winston wolff - (646) 827-2242 - http://www.stratolab.com - learning by creating
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss