you are right, init is only called the very first time the servlet is accessed,

jose wrote:

Dear Aaron,

By moving the template compilation to the init, should give me a
performance boost because I am not compiling the template everytime the
servlet is called.  Is that correct?  Or does it something else for me
that I am missing?

Jose

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Aaron
Held
Sent: Wednesday, June 30, 2004 8:04 PM
To: jose
Cc: 'Webware'
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







-------------------------------------------------------
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