Hi, Long time list lurker,
This is basically how i do it as well. Ive never really had a chance to "load" test and wondered what sort of effect using a single template reference has. I was under the impression that some kind of lock was required? My base class page is composed of the basic html page structure, head and body, with $content hooks etc that the inherited classes plug their content templates into. I really dont like the "standard" writeContent, writeHead methods, and feel that generating html within the application code is a bad thing. Is this the correct approach? Regards, Leith ----- Original Message ----- From: "Aaron Held" <[EMAIL PROTECTED]> To: "jose" <[EMAIL PROTECTED]> Cc: "'Webware'" <[EMAIL PROTECTED]> Sent: Thursday, July 01, 2004 1:03 PM Subject: Re: [Webware-discuss] Cheetah templates > try moving the template compilation to the servelet init function > > Class testPage(Page): > def __init__(self): > self.t = Template(file='template.tmpl', searchList=[self]) > def writeContent(self): > self.write(t) > > > > > jose wrote: > > >Hi all, I'm fishing for advice. I have recently been looking at > >different templating solutions to use with webware. At the moment I am > >looking at cheetah and zpt. To compare them more directly I was > >basically building the same project with both of them to see how they > >worked. I was using cheetah like this: > > > >================ > >from WebKit.Page import Page > >from Cheetah.Template import Template > > > >Class testPage(Page): > > def writeContent(self): > > t = Template(file='template.tmpl', searchList=[self]) > > self.write(t) > > > > > >================= > > > >I know that I am taking a performance hit by using the templates in this > >way, but aside from that is there any real disadvantages? Or is there a > >better way to use cheetah within a servlet. > > > >BTW just for reference, I generally like to have my servlets call and > >use templates, so a single servlet can technically use different > >templates depending on the circumstance that it is used. > > > >Jose > > > > > > > > > >------------------------------------------------------- > >This SF.Net email sponsored by Black Hat Briefings & Training. > >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > >digital self defense, top technical experts, no vendor pitches, > >unmatched networking opportunities. Visit www.blackhat.com > >_______________________________________________ > >Webware-discuss mailing list > >[EMAIL PROTECTED] > >https://lists.sourceforge.net/lists/listinfo/webware-discuss > > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Webware-discuss mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/webware-discuss > ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss