Denny,

As a developer who has been developing coldfusion applications now for 11
years, let me say this. Although the onRequestStart and onRequestEnd in
Application.cfc is a good method for very lazy programmers, or if you're
header and footer information never changes, but consider this.

Custom Tag: If you developed a custom tag that could create the template
required, you then have something that you could reuse in other sites by
changing the style sheet, and minimise your work.

But the biggest down side to the Application.cfc method you described, is
you would never be able to introduce Ajax, or even webservices into your
application or any form of Flex functionality.

So think about how you want to expand your application first, or if you have
to expand your application in the future and what problems you might have in
doing this before deciding any solution to be the best.

My advice would be to never use onRequestStart or onRequestEnd in that way
to do header and footer processing.

However if you would like to see an example of how one might use
onRequestStart and end have a look at this. It has been constructed as a
proof of concept, but it shows the power that you have and removing white
space in this example is easy enough too.

http://www.andyscott.id.au/index.cfm/2006/9/12/Proof-of-Concept


Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273
 

-----Original Message-----
From: Denny Valliant [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 5 October 2006 8:26 AM
To: CF-Talk
Subject: Re: Headers and Footers

On 10/3/06, Teddy Payne <[EMAIL PROTECTED]> wrote:
> If you use Application.cfc, you can use the onRequest method to intercept
> your page loads.

I've used onRequestStart and onRequestEnd to add headers and footers,
works quite well aside from the fact that you then need a variable
when you don't want the header/footer, like for XML stuff for JS or
whathaveyou.

I don't like the <cfinclude> on each page much for the reason I don't
like DW templates.
I'd way rather have a <cfinclude> than a DW template though... you can
be pretty sure a global find and replace will catch the whole bit you
want.
*
Yeah, ModelGlue takes care of this stuff, and many other nifty issues,
quite readily.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255571
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to