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

Reply via email to