here is a copy of my cheetahPages file to look at. To use it in a
servlet I usually write my servlets like this:
from cheetahPages import cheetahPage
My cheetahPages files does a couple of things for me. First it creates
a cheetahTemplate object which takes care pasisng the correct
searchList to the template, which is usually passed to render as an
argument. The cheetahPage class does all the real work. It takes a
template (which can be named anything you want, I always use .html
instead of the conventional .tmpl because Dreamweaver deals with it
easier) and compiles the template into a compiled template and loads
the template. If the template is already compiled, it checks the date
of the compiled template against template file and recompiles if needed
(this is a little weak, because my original code, commented out, was
compiling too often), and reloads the compiled template if needed.
Like I said this is only one way to use cheetah, but it really works
well for me. You'll notice the templateRoot function. This returns
the relative location of the templates folder (assumed to be the same
as the servlet if it si not overwritten). If templateRoot is present
it looks there for the template files, this helps keep all my templates
in one nice little package again separate from my servlets. Hope this
> -------- Original Message --------
> Subject: Re: [Webware-discuss] several questions about webware
> From: "Sam Nilsson" <sam@...>
> Date: Mon, January 31, 2005 12:24 am
> To: "jose" <jose@...>
> jose wrote:
> > I find that this keeps my presentation code
> > nicely separated from my program code, and keeps the templates very clean.
> > I would be happy to share my cheetahPage with anyone if there is interest.
> > Jose
> Hi Jose,
> I would appreciate taking a look at your cheetahPage!
> - Sam Nilsson
Get latest updates about Open Source Projects, Conferences and News.