onRequestStart onRequest variable assignments

2014-12-29 Thread Don

This application I inherited, certain variables are not persisting their values 
between onRequestStart and onRequest.

I've been writing to a log file to document the changes. Seems to be happening 
just after onRequestStart ends and onRequest begins. Values are being reset. So 
the variables themselves still exist, just their value is being altered and I 
cannot see where it is happening.

am I missing something obvious?



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359891
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: onRequestStart onRequest variable assignments

2014-12-29 Thread David Phelan

Don,

You state that certain variables are being reset so then I assume that others 
are maintaining their values?  Is there any difference in scope between those 
that are maintaining their values and those that are not?  Is there a 
conditional redirect happening in OnRequestStart?

Dave

-Original Message-
From: Don [mailto:danfar...@hotmail.com] 
Sent: Monday, December 29, 2014 2:19 PM
To: cf-talk
Subject: onRequestStart  onRequest variable assignments


This application I inherited, certain variables are not persisting their values 
between onRequestStart and onRequest.

I've been writing to a log file to document the changes. Seems to be happening 
just after onRequestStart ends and onRequest begins. Values are being reset. So 
the variables themselves still exist, just their value is being altered and I 
cannot see where it is happening.

am I missing something obvious?





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359892
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


How to Determine CFC Method Called From OnRequestStart?

2009-07-11 Thread Matthew Reinbold

I'm currently trying to add logging to a webservice I've created. I'm not crazy 
about numerous lines of cflog inside the webservice itself; it seemed that I 
should be able to put a single line in the application.cfc's OnRequestStart 
method (not OnRequest as that won't work for remote calls) and have any and all 
calls within the webservice covered. 

The first snag was that IsSOAPRequest() only seems to return true when INSIDE a 
cfc function. I ended up watching the cgi.HTTP_ACCEPT variable for soap+xml. 
With my simple examples this seems to give an indication of when I'm dealing 
with a web service call. 

The next problem, however, has me stumped. At a very minimum I want to record 
which cfc method is being called. I've got access to the target page in the 
arguments scope. I also haven't exhausted the possibilities of the 
getSoap() functions but, like the IsSoapRequest() I'm afraid it might just 
not be available in the OnRequestStartMethod(). Extra peachy keen if, based on 
an application debug variable, one could also record the parameters passed in.

How does one find out what method is being called via a SOAP request on the 
OnRequestStart method?

Matthew Reinbold
Creative Principal, Vox Pop Design, http://voxpopdesign.com 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324437
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: How to Determine CFC Method Called From OnRequestStart?

2009-07-11 Thread James Holmes

You could try to put the logging in one place in the webservice cfc;
in the pseudo-constructor area. Since that's in the CFC, perhaps
isSOAPRequest()  will work there (too lazy to check).

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/7/11 Matthew Reinbold matthew.reinb...@voxpopdesign.com:

 I'm currently trying to add logging to a webservice I've created. I'm not 
 crazy about numerous lines of cflog inside the webservice itself; it seemed 
 that I should be able to put a single line in the application.cfc's 
 OnRequestStart method (not OnRequest as that won't work for remote calls) and 
 have any and all calls within the webservice covered.

 The first snag was that IsSOAPRequest() only seems to return true when INSIDE 
 a cfc function. I ended up watching the cgi.HTTP_ACCEPT variable for 
 soap+xml. With my simple examples this seems to give an indication of when 
 I'm dealing with a web service call.

 The next problem, however, has me stumped. At a very minimum I want to record 
 which cfc method is being called. I've got access to the target page in the 
 arguments scope. I also haven't exhausted the possibilities of the 
 getSoap() functions but, like the IsSoapRequest() I'm afraid it might 
 just not be available in the OnRequestStartMethod(). Extra peachy keen if, 
 based on an application debug variable, one could also record the parameters 
 passed in.

 How does one find out what method is being called via a SOAP request on the 
 OnRequestStart method?

 Matthew Reinbold
 Creative Principal, Vox Pop Design, http://voxpopdesign.com

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324438
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


onApplicationStart Vs onRequestStart

2008-09-28 Thread Sherif Abdou
I am new to ColdFusion and I am having trouble understanding what is the 
Difference between onApplicationStart method and onRequestStart method other 
than the Scope. For Example what does it mean by Application? First time a 
user comes to your site? Does it only run once? I tried to set a Variable in 
the onApplicationStart method like cfset APPLICATION.ds=myDataSource/ 
and I get an Error when I say use it in index.cfm. Am i allowed to use this 
outside in other files Or anything that gets set in onApplicationStart gets 
passed to onApplicationEnd and thats where the variable get used? Thanks. 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313190
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: onApplicationStart Vs onRequestStart

2008-09-28 Thread Will Tomlinson
I am new to ColdFusion and I am having trouble understanding what is the 
Difference between onApplicationStart method and onRequestStart method other 
than the Scope. For Example what does it mean by Application? First time a 

onapplicationstart() runs when the first cfm or cfc is executed in your 
application. onrequeststart() runs every page request. 

Yes, you can set application-wide variables in onapplicationstart(). 

cfset application.dsn = someDSN'

You can use that variable throughout your application, on all pages. 

index.cfm should be able to use:

cfoutput#application.dsn#/cfoutput

Remember, you MUST prefix the scope to the variable name when it comes to 
application variables. Same goes for session variables and some others.

Whenever you're in doubt, dump the whole application scope on a page, like so:

cfdump var=#application#

Check it out and see what's there.  

Will 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313191
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: onApplicationStart Vs onRequestStart

2008-09-28 Thread Steve Nelson
OnApplicationStart runs the first time ANY user hits your site. It's
commonly used for setting application variables that rarely change. Things
like datasources are a good place for that or initializing a ton of
cfobjects. I commonly put a cfif statement in my onRequest event to reset
the application variables. like this:

cffunction name=OnRequest
  cfif isDefined(attributes.resetVars)
 cfset onApplicationStart()/
  /cfif
/cffunction

That way if you can rerun the function from any request.

Steve

On Sun, Sep 28, 2008 at 8:57 PM, Sherif Abdou [EMAIL PROTECTED]wrote:

 I am new to ColdFusion and I am having trouble understanding what is the
 Difference between onApplicationStart method and onRequestStart method
 other
 than the Scope. For Example what does it mean by Application? First time a
 user comes to your site? Does it only run once? I tried to set a Variable
 in
 the onApplicationStart method like cfset APPLICATION.ds=myDataSource/
 and I get an Error when I say use it in index.cfm. Am i allowed to use this
 outside in other files Or anything that gets set in onApplicationStart gets
 passed to onApplicationEnd and thats where the variable get used? Thanks.



 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313192
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: onApplicationStart Vs onRequestStart

2008-09-28 Thread s. isaac dealey
 I am new to ColdFusion and I am having trouble understanding what is the 
 Difference between onApplicationStart method and onRequestStart method other 
 than the Scope. For Example what does it mean by Application? First time a 
 user comes to your site? Does it only run once? I tried to set a Variable in 
 the onApplicationStart method like cfset APPLICATION.ds=myDataSource/ 
 and I get an Error when I say use it in index.cfm. Am i allowed to use this 
 outside in other files Or anything that gets set in onApplicationStart gets 
 passed to onApplicationEnd and thats where the variable get used? Thanks. 

Hi Sherif, 

Welcome to the community. :)

The onApplicationStart and onRequest start events are simply events
which occur at a given time and aren't actually tied to any variable
scopes, other than the fact that onApplicationStart executes immediately
after the application scope is created. But you can do whatever you want
to in that method. For example, you can create request variables in the
onApplicationStart method, even though it executes before onRequestStart. 

So the lifespan of an application looks like this: 

1. onApplicationStart 

2. onSessionStart 

3. onRequestStart 
4. index.cfm
5. onRequestEnd 

6. return to 3 (onRequestStart) and repeat 

7. onSessionEnd - user timed out 
8. return to 2 (onSessionStart) and repeat for other users 

9. onApplicationEnd - application timed out 

10. return to 1 (onApplicationStart) the next time the site is visited

You can use application variables in index.cfm -- they need to be
properly scoped, but if you set them in the onApplicationStart method
they should be available. Your onApplicationStart method may not be
executing if you haven't specified a name for your application. So your
Application.cfc should look similar to this: 

cfcomponent
cfset this.name = myapplication /

cffunction name=onApplicationStart access=public
  cfset application.ds = myDataSource /
/cffunction


/cfcomponent

You can also look to see what variables you have in your application
scope from your index.cfm template by dumping the structure like this: 

cfdump var=#application# /

hth

-- 
s. isaac dealey  ^  new epoch
 isn't it time for a change? 
 ph: 781.769.0723

http://onTap.riaforge.org/blog



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313193
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: onApplicationStart Vs onRequestStart

2008-09-28 Thread Sherif Abdou
Oh Ok I found what the problem is, I guess my Varaibles in the 
onApplicationStart got cached, so when I sent it once, launched and then I 
added another Variables after launched again the application variables dont' 
get updated. Now How would i prevent it from getting cached?
--
Sherif Abdou
http://VadexFX.com
http://Sherifabdou.com
- Original Message - 
From: s. isaac dealey [EMAIL PROTECTED]
To: cf-talk cf-talk@houseoffusion.com
Sent: Sunday, September 28, 2008 8:42 PM
Subject: Re: onApplicationStart Vs onRequestStart


 I am new to ColdFusion and I am having trouble understanding what is the
 Difference between onApplicationStart method and onRequestStart method 
 other
 than the Scope. For Example what does it mean by Application? First time 
 a
 user comes to your site? Does it only run once? I tried to set a Variable 
 in
 the onApplicationStart method like cfset APPLICATION.ds=myDataSource/
 and I get an Error when I say use it in index.cfm. Am i allowed to use 
 this
 outside in other files Or anything that gets set in onApplicationStart 
 gets
 passed to onApplicationEnd and thats where the variable get used? Thanks.

 Hi Sherif,

 Welcome to the community. :)

 The onApplicationStart and onRequest start events are simply events
 which occur at a given time and aren't actually tied to any variable
 scopes, other than the fact that onApplicationStart executes immediately
 after the application scope is created. But you can do whatever you want
 to in that method. For example, you can create request variables in the
 onApplicationStart method, even though it executes before onRequestStart.

 So the lifespan of an application looks like this:

 1. onApplicationStart

 2. onSessionStart

 3. onRequestStart
 4. index.cfm
 5. onRequestEnd

 6. return to 3 (onRequestStart) and repeat

 7. onSessionEnd - user timed out
 8. return to 2 (onSessionStart) and repeat for other users

 9. onApplicationEnd - application timed out

 10. return to 1 (onApplicationStart) the next time the site is visited

 You can use application variables in index.cfm -- they need to be
 properly scoped, but if you set them in the onApplicationStart method
 they should be available. Your onApplicationStart method may not be
 executing if you haven't specified a name for your application. So your
 Application.cfc should look similar to this:

 cfcomponent
 cfset this.name = myapplication /

 cffunction name=onApplicationStart access=public
  cfset application.ds = myDataSource /
 /cffunction

 
 /cfcomponent

 You can also look to see what variables you have in your application
 scope from your index.cfm template by dumping the structure like this:

 cfdump var=#application# /

 hth

 -- 
 s. isaac dealey  ^  new epoch
 isn't it time for a change?
 ph: 781.769.0723

 http://onTap.riaforge.org/blog



 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313195
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: onApplicationStart Vs onRequestStart

2008-09-28 Thread James Holmes
The whole point of putting variables into the application scope is to cache
them so you don't have to set them on every request.

The reason your variables didn't get set after you added new ones was that
your application had already started; OnApplicationStart doesn't run on
every request.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/


2008/9/29 Sherif Abdou

 Oh Ok I found what the problem is, I guess my Varaibles in the
 onApplicationStart got cached, so when I sent it once, launched and then I
 added another Variables after launched again the application variables
 dont'
 get updated. Now How would i prevent it from getting cached?
 --


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313196
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: setting page variables in onRequestStart

2008-05-23 Thread Raymond Camden
Err, how is it a 'pseudo-scope? The request scope is a real scope
(don't give it any confidence issues!) just as much as Variables. And
I'll repeat my earlier assertion - that maybe seeing Request.Foo will
help it stand out compared to Variables.goo.

On Thu, May 22, 2008 at 8:21 PM, Dominic Watson
[EMAIL PROTECTED] wrote:
 I'd argue that variables he is setting on - every- page request should
 be segregated for normal page variables. If I see request.siteURL for
 example, it flags it as a variable that is always available, as
 opposed to just 'X' for example.

 Sure, I'd be with you usually; but this is an entire 'pseudo scope'.
 Would you argue for MG to use request.viewstate over just viewstate?
 That wouldn't be so bad actually thinking about it; always bugged me a
 little referencing viewstate without a scope lol

-- 
===
Raymond Camden, VP of Software Dev, Broadchoice

Email : [EMAIL PROTECTED]
Blog : www.coldfusionjedi.com
AOL IM : cfjedimaster

Keep up to date with the community: http://www.coldfusionbloggers.org

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-23 Thread Adrian Moreno
During our site rewrite, we opted to use the request scope over the variables 
scope for all view (CFM) pages. We use onRequestStart() to make sure certain 
global site variables are available in the request scope. 

After reading this article:
http://www.schierberl.com/cfblog/index.cfm/2006/10/16/memoryLeak_variablesScope

it turns out using the request scope everywhere was a great boon to the 
project. One of our legacy applications uses Application.cfm, relies on the 
variables scope and has major memory issues. If you look down in his Summary, 
#4 says Calling structClear(variables) in onRequestEnd.cfm will destroy 
unwanted references tied to variables scope.

We added this code to one server in the middle of the day and watched the 
memory on that server drop like a rock as soon as it deployed. We promoted it 
to the rest of the servers and they've all been behaving much better ever since.

-- Adrian

Err, how is it a 'pseudo-scope? The request scope is a real scope
(don't give it any confidence issues!) just as much as Variables. And
I'll repeat my earlier assertion - that maybe seeing Request.Foo will
help it stand out compared to Variables.goo.

On Thu, May 22, 2008 at 8:21 PM, Dominic Watson
[EMAIL PROTECTED] wrote:
-- 
===
Raymond Camden, VP of Software Dev, Broadchoice

Email : [EMAIL PROTECTED]
Blog : www.coldfusionjedi.com
AOL IM : cfjedimaster

Keep up to date with the community: http://www.coldfusionbloggers.org 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


RE: setting page variables in onRequestStart

2008-05-23 Thread Dawson, Michael
Just so I'm clear on this...

You are using the request scope for EVERY variable you set or ONLY the
global variables?

In other words, do you use the variables scope at all on the view
pages?

Would you have used:

cfquery name=request.myQuery ... ?

m!ke 

-Original Message-
From: Adrian Moreno [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 23, 2008 10:23 AM
To: CF-Talk
Subject: Re: setting page variables in onRequestStart

During our site rewrite, we opted to use the request scope over the
variables scope for all view (CFM) pages. We use onRequestStart() to
make sure certain global site variables are available in the request
scope. 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


RE: setting page variables in onRequestStart

2008-05-23 Thread Dave Watts
 In other words, do you use the variables scope at all on the view
 pages?
 
 Would you have used:
 
 cfquery name=request.myQuery ... ?

If it's really a view page, in an MVC pattern, you wouldn't have any CFQUERY
tags in it.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Training: Adobe/Google/Paperthin Certified Partners
http://training.figleaf.com/

WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers!
http://www.webmaniacsconference.com/

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


RE: setting page variables in onRequestStart

2008-05-23 Thread Dawson, Michael
Of course, but that was just an example.

m!ke 

-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 23, 2008 1:44 PM
To: CF-Talk
Subject: RE: setting page variables in onRequestStart

 In other words, do you use the variables scope at all on the view
 pages?
 
 Would you have used:
 
 cfquery name=request.myQuery ... ?

If it's really a view page, in an MVC pattern, you wouldn't have any
CFQUERY tags in it.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


RE: setting page variables in onRequestStart

2008-05-23 Thread Dave Watts
   In other words, do you use the variables scope at all on the view
   pages?
   
   Would you have used:
  
   cfquery name=request.myQuery ... ?
  
  If it's really a view page, in an MVC pattern, you wouldn't 
  have any CFQUERY tags in it.
 
 Of course, but that was just an example.

Yeah, that was really for the benefit of others, not for you personally.

That said, I've seen a lot of people use only Request variables in their
pages for this sort of thing.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


RE: setting page variables in onRequestStart

2008-05-23 Thread Dave Watts
 During our site rewrite, we opted to use the request scope 
 over the variables scope for all view (CFM) pages. We use 
 onRequestStart() to make sure certain global site variables 
 are available in the request scope. 
 
 After reading this article:
 http://www.schierberl.com/cfblog/index.cfm/2006/10/16/memoryLe
 ak_variablesScope
 
 it turns out using the request scope everywhere was a great 
 boon to the project. One of our legacy applications uses 
 Application.cfm, relies on the variables scope and has major 
 memory issues. If you look down in his Summary, #4 says 
 Calling structClear(variables) in onRequestEnd.cfm will 
 destroy unwanted references tied to variables scope.
 
 We added this code to one server in the middle of the day and 
 watched the memory on that server drop like a rock as soon as 
 it deployed. We promoted it to the rest of the servers and 
 they've all been behaving much better ever since.

I read that article, and while I'm glad this turned out well for you, there
seems to be a serious misunderstanding in the article about how Java garbage
collection works in CF. The garbage collection doesn't run after every
request, by default - and you wouldn't want it to, either. Garbage
collection is an expensive operation. And just destroying the unwanted
references in onRequestEnd.cfm or the onRequestEnd method in Application.cfc
isn't going to change that - it just means that those variables will be
immediately eligible for garbage collection whenever it runs, as long as
those variables have no other references in the stack.

This isn't a memory leak. Java will eventually reclaim and reallocate that
memory.

That said, I'm not sure what's different about using Request variables in
this way, since they're just references like any other reference, and the
values stored in the heap should be destroyed by the garbage collector the
same way.

Finally, if you're creating truly global site variables, why not just use
the Application scope? That's what it's for, after all. You don't have to
worry about the silly locking issues like you did with CF 5 and earlier. Of
course, if things are working as they are, it's probably not worth changing
now.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-23 Thread Adam Haskell
My only problem with Request scope is that its available _everywhere_. I
understand you can be a good developer and not use it in your model or
elsewhere but I still dislike the request scope for that reason. Being a
person that is constantly working on framework and components to be used in
my company I cherish encapsulation and request scope spits in the face of
that. Sure Application and Session do too but they server a good purpose for
carrying state so I like them :)  I do like your point about global
variables for the life of the request and being easy to differentiate
between those and page variables. I am with Dave though maybe Application or
Session would be a better place for that info? Just my 2 cents.

Also check out what Sean did with Application.cfc in fusebox very clever to
get around most of the limitations/issues with onRequest.

Adam Haskell


On Thu, May 22, 2008 at 4:17 PM, Raymond Camden [EMAIL PROTECTED] wrote:

 Right, you can't do that. The variables scope in App.cfc isn't copied
 to the template.

 Unless you use onRequest. But that has some drawbacks as well.

 Why not simply simply use the Request scope?

 On Thu, May 22, 2008 at 3:10 PM, Richard White [EMAIL PROTECTED] wrote:
  hi
 
  is it possible to set page variables in the onRequestStart method of the
 application.cfc?
 
  if i enter the following code in the application.cfc:
 
  cfset variables.myVariable = myVariable
 
  and the following code in my page:
 
  cfoutput#myVariable#/cfoutput
 
  i get an error message when running a page saying myVariable is not
 defined
 
 

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-23 Thread Dominic Watson

 Err, how is it a 'pseudo-scope? The request scope is a real scope
 (don't give it any confidence issues!) just as much as Variables. And
 I'll repeat my earlier assertion - that maybe seeing Request.Foo will
 help it stand out compared to Variables.goo.


;) You mis-read me (and I express badly). For example, MG3 has introduced
the 'helpers' 'pseudo-scope'. With this, you put all your UDFs in a folder
called helpers and the app automagically places them all in a variable
called helpers. So then, in your cfms, or even your cfcs (yuck), you could
do:

cfset result = helpers.stringUdfs.myStringFunction('foo')

So here, 'helpers' is sort of a 'pseudo-scope'. Sure, it's just a structure
in the variables scope that has collections of udfs as its keys, but I think
the 'pseudo-scope' is a good term for it. This is what I was trying to
recreate for Richard - but I failed to calculate the inability to set
anything in the variables scope in application.cfc (the 'global' variables
scope outside of the cfc that is).

The request scope is absolutely fine. However, in this case, we were putting
the collection of udfs in the application scope and then wanting to create a
'pseudo-scope' for them to avoid verbosity. If that isn't possible, then the
best place for them is just to stay in the application scope (logically
where they belong):

cfset result = application.helpers.myStringFunction('foo')

But yeh, I completely agree that variables should sit in the scopes where
they belong - but I also like the idea of creating 'pseudo-scopes' if it
readable to do so ;)

Dominic

-- 
Blog it up: http://fusion.dominicwatson.co.uk


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-23 Thread Dominic Watson
 My only problem with Request scope is that its available _everywhere_. I
 understand you can be a good developer and not use it in your model or
 elsewhere but I still dislike the request scope for that reason. Being a
 person that is constantly working on framework and components to be used in
 my company I cherish encapsulation and request scope spits in the face of
 that. Sure Application and Session do too but they server a good purpose for
 carrying state so I like them :)  I do like your point about global
 variables for the life of the request and being easy to differentiate
 between those and page variables. I am with Dave though maybe Application or
 Session would be a better place for that info? Just my 2 cents.

I agree with you for most app building. However, I was recently tasked
with building a pretty much flat site but where ColdFusion templating
would be really useful. For this simple app, I just setup
onRequestEnd.cfm to be the HTML template that outputted
#request.header# for various page specific header tags (javascript,
etc) and #request.body# for the main content.  Each individual page
would then just savecontent to request.body and possibly
request.header to be outputted later in onRequestEnd.cfm. The request
scope was the logical place for these variables.

(I'm sure that onRequestEnd tactic must have been / is a common tactic
- not claiming originality!)

Dominic

--
Blog it up: http://fusion.dominicwatson.co.uk

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


setting page variables in onRequestStart

2008-05-22 Thread Richard White
hi

is it possible to set page variables in the onRequestStart method of the 
application.cfc?

if i enter the following code in the application.cfc:

cfset variables.myVariable = myVariable

and the following code in my page:

cfoutput#myVariable#/cfoutput

i get an error message when running a page saying myVariable is not defined 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Raymond Camden
Right, you can't do that. The variables scope in App.cfc isn't copied
to the template.

Unless you use onRequest. But that has some drawbacks as well.

Why not simply simply use the Request scope?

On Thu, May 22, 2008 at 3:10 PM, Richard White [EMAIL PROTECTED] wrote:
 hi

 is it possible to set page variables in the onRequestStart method of the 
 application.cfc?

 if i enter the following code in the application.cfc:

 cfset variables.myVariable = myVariable

 and the following code in my page:

 cfoutput#myVariable#/cfoutput

 i get an error message when running a page saying myVariable is not defined

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Richard White
thanks Raymond

i haven't yet looked into the request scope but will do now!

thanks again

Right, you can't do that. The variables scope in App.cfc isn't copied
to the template.

Unless you use onRequest. But that has some drawbacks as well.

Why not simply simply use the Request scope?

On Thu, May 22, 2008 at 3:10 PM, Richard White [EMAIL PROTECTED] wrote:
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Dominic Watson
 Why not simply simply use the Request scope?

Verbosity. The idea he is working on is doing something similar to the
way MG3 creates the 'helper scope' for udfs. I think helpers.myUdf()
is preferable to request.helpers.myUdf() though its all good. Clearly
with MG, the helper/event/viewstate variables are setup outside of any
cfcs and I hadn't figured that in the sample code I came up with (I
still use application.cfm).

Dominic

-- 
Blog it up: http://fusion.dominicwatson.co.uk

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Raymond Camden
I'd argue that variables he is setting on - every- page request should
be segregated for normal page variables. If I see request.siteURL for
example, it flags it as a variable that is always available, as
opposed to just 'X' for example.

On Thu, May 22, 2008 at 5:15 PM, Dominic Watson
[EMAIL PROTECTED] wrote:
 Why not simply simply use the Request scope?

 Verbosity. The idea he is working on is doing something similar to the
 way MG3 creates the 'helper scope' for udfs. I think helpers.myUdf()
 is preferable to request.helpers.myUdf() though its all good. Clearly
 with MG, the helper/event/viewstate variables are setup outside of any
 cfcs and I hadn't figured that in the sample code I came up with (I
 still use application.cfm).

 Dominic




-- 
===
Raymond Camden, VP of Software Dev, Broadchoice

Email : [EMAIL PROTECTED]
Blog : www.coldfusionjedi.com
AOL IM : cfjedimaster

Keep up to date with the community: http://www.coldfusionbloggers.org

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Dominic Watson
 I'd argue that variables he is setting on - every- page request should
 be segregated for normal page variables. If I see request.siteURL for
 example, it flags it as a variable that is always available, as
 opposed to just 'X' for example.

Sure, I'd be with you usually; but this is an entire 'pseudo scope'.
Would you argue for MG to use request.viewstate over just viewstate?
That wouldn't be so bad actually thinking about it; always bugged me a
little referencing viewstate without a scope lol

Dominic

-- 
Blog it up: http://fusion.dominicwatson.co.uk

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Brian Kotek
variables.viewState?

On Thu, May 22, 2008 at 9:21 PM, Dominic Watson 
[EMAIL PROTECTED] wrote:

  I'd argue that variables he is setting on - every- page request should
  be segregated for normal page variables. If I see request.siteURL for
  example, it flags it as a variable that is always available, as
  opposed to just 'X' for example.

 Sure, I'd be with you usually; but this is an entire 'pseudo scope'.
 Would you argue for MG to use request.viewstate over just viewstate?
 That wouldn't be so bad actually thinking about it; always bugged me a
 little referencing viewstate without a scope lol

 Dominic

 --
 Blog it up: http://fusion.dominicwatson.co.uk

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


Re: setting page variables in onRequestStart

2008-05-22 Thread Dominic Watson
 variables.viewState?

Ok Mr Pedant, pick up on the useless bit of the post damn you

:p

-- 
Blog it up: http://fusion.dominicwatson.co.uk

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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


onRequestStart()

2008-03-20 Thread Scott Stewart
Hey all, 

 

I’m trying to include some code to check for the existence of a
session.variable (session.loggedin)

Is this something that should be dropped into onRequestStart() in the
Application.cfc?

 

Here’s the code

 

cffunction name=onRequestStart

cfif IsDefined(session.loggedIn)

cfswitch expression=#session.loggedin#

cfcase value=1

/cfcase

cfcase value=0

cflocation url=../admin/login.cfm

/cfcase

 /cfswitch

cfelse

cflocation url=../admin/login.cfm

/cfif

/cffunction

 

Secondly, how should I handle the cflocations? 

 

 

-- 

Scott Stewart

ColdFusion Developer

 

SSTWebworks

4405 Oakshyre Way

Raleigh, NC. 27616

(919) 874-6229 (home)

(703) 220-2835 (cell)

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.7/1335 - Release Date: 3/19/2008
9:54 AM
 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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


Re: onRequestStart()

2008-03-20 Thread Greg Morphis
Here's an snippet of my onRequestStart, yeah you can check for session
variables in there..

cfif structkeyexists(session.user,emplid) and
structkeyexists(url,group_id)
cfset qGroups = 
application.userGateway.getGroupsForUser(emplid =
session.user.emplid)/

cfset lstGroups = ValueList(qGroups.group_id) /
!--cfdump var=#lstGroups# /

cfif not listfind(lstGroups,url.group_id)
cflocation url=index.cfm?action=home 
addtoken=no
/cfif

/cfif



On Thu, Mar 20, 2008 at 11:24 AM, Scott Stewart
[EMAIL PROTECTED] wrote:
 Hey all,



  I'm trying to include some code to check for the existence of a
  session.variable (session.loggedin)

  Is this something that should be dropped into onRequestStart() in the
  Application.cfc?



  Here's the code



  cffunction name=onRequestStart

  cfif IsDefined(session.loggedIn)

 cfswitch expression=#session.loggedin#

 cfcase value=1

 /cfcase

 cfcase value=0

 cflocation url=../admin/login.cfm

 /cfcase

  /cfswitch

 cfelse

 cflocation url=../admin/login.cfm

 /cfif

  /cffunction



  Secondly, how should I handle the cflocations?





  --

  Scott Stewart

  ColdFusion Developer



  SSTWebworks

  4405 Oakshyre Way

  Raleigh, NC. 27616

  (919) 874-6229 (home)

  (703) 220-2835 (cell)




  No virus found in this outgoing message.
  Checked by AVG.
  Version: 7.5.519 / Virus Database: 269.21.7/1335 - Release Date: 3/19/2008
  9:54 AM



  

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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


Re: onRequestStart()

2008-03-20 Thread Tom McNeer
As Greg says, yes, you can certainly check for the variables in
onRequestStart().

In onSessionStart() (which will fire before onRequestStart), do something
like:

cfset session.loggedIn = false /

Then the variable should always exist (although it would still be good
practice to test for its existence, as you did in your sample code.

In onRequestStart(), you could then do:

cfif isDefined(session.loggedIn)
 cfif NOT session.loggedIn
   cflocation url=../admin/login.cfm
 /cfif
cfelse
  cflocation url=../admin/login.cfm
/cfif


-- 
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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


RE: onRequestStart()

2008-03-20 Thread Scott Stewart
Thanks all

-- 
Scott Stewart
ColdFusion Developer
 
SSTWebworks
4405 Oakshyre Way
Raleigh, NC. 27616
(919) 874-6229 (home)
(703) 220-2835 (cell)

-Original Message-
From: Tom McNeer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 20, 2008 1:17 PM
To: CF-Talk
Subject: Re: onRequestStart()

As Greg says, yes, you can certainly check for the variables in
onRequestStart().

In onSessionStart() (which will fire before onRequestStart), do something
like:

cfset session.loggedIn = false /

Then the variable should always exist (although it would still be good
practice to test for its existence, as you did in your sample code.

In onRequestStart(), you could then do:

cfif isDefined(session.loggedIn)
 cfif NOT session.loggedIn
   cflocation url=../admin/login.cfm
 /cfif
cfelse
  cflocation url=../admin/login.cfm
/cfif


-- 
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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


Setting session param in onRequestStart

2007-08-08 Thread Josh Nathanson
Hey all,

Had an interesting conundrum today.  I wanted to param a session variable in 
Application.cfc, so naturally I placed the cfparam name=session.myvar 
default=false in onSessionStart.  I quickly realized that this does not 
catch people whose sessions are already in progress.  Since we pretty much 
have sessions running on our production server 24/7, there is never a time 
when I could post the updated Application.cfc and not get a bunch of myvar 
not defined in session errors.

Solutions would be to a) restart the server or otherwise end all sessions 
(not viable), b) use structKeyExists(session,mvar) anywhere the variable 
is used, or c) place the cfparam name=session.myvar in onRequestStart. 
I chose c) as it is the most DRY (Don't Repeat Yourself) to implement, but 
I'm wondering if it is bad practice to param a session variable in 
onRequestStart, or if other folks have been in a similar situation and done 
anything differently.

-- Josh 


~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us

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


onRequestStart

2006-10-18 Thread Brian Peddle
In my onRequestStart a variable is set for request.user  some 
processing is done and it never really needs to be updated again.  Im 
trying to do  cfif isdefined(request.user) to see if it has been set 
in the onrequeststart but it is never defined.

As I write this I am guessing the request variable needs to be set each 
time in there to.

First Page Load --- event.user is set
Second Page --- check if event.user is set, but I guess it may not carry 
page to page?

Not sure if I am being clear enough.

~|
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:257207
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: onRequestStart

2006-10-18 Thread Ben Nadel
You are correct, REQUEST is a single-page persisting object. In only
lasts for the duration of the page request and then is destroyed.
SESSION and APPLICATION are cross-page persisting scopes. You might want
to try setting it into SESSION. 

..
Ben Nadel
Certified Advanced ColdFusion Developer
www.bennadel.com
 

-Original Message-
From: Brian Peddle [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 18, 2006 11:37 AM
To: CF-Talk
Subject: onRequestStart

In my onRequestStart a variable is set for request.user  some
processing is done and it never really needs to be updated again.  Im
trying to do  cfif isdefined(request.user) to see if it has been set
in the onrequeststart but it is never defined.

As I write this I am guessing the request variable needs to be set each
time in there to.

First Page Load --- event.user is set
Second Page --- check if event.user is set, but I guess it may not carry
page to page?

Not sure if I am being clear enough.



~|
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:257214
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: onRequestStart

2006-10-18 Thread loathe
Request is not a scope that is available across multiple requests, it has to
be recreated for each page request.

Your looking for session or client.

 -Original Message-
 From: Brian Peddle [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, October 18, 2006 11:37 AM
 To: CF-Talk
 Subject: onRequestStart
 
 In my onRequestStart a variable is set for request.user  some
 processing is done and it never really needs to be updated again.  Im
 trying to do  cfif isdefined(request.user) to see if it has been set
 in the onrequeststart but it is never defined.
 
 As I write this I am guessing the request variable needs to be set each
 time in there to.
 
 First Page Load --- event.user is set
 Second Page --- check if event.user is set, but I guess it may not carry
 page to page?
 
 Not sure if I am being clear enough.
 
 

~|
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:257216
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: onRequestStart

2006-10-18 Thread Teddy Payne
How often does the variable need to be updated?  OnRequestStart will execute
prior to every page request.  If it less frequent than that, I would
recommend putting it in the application start.  You can use onRequestStart
to check to see if the variable needs to be updated in the application
scope.

Teddy

On 10/18/06, Brian Peddle [EMAIL PROTECTED] wrote:

 In my onRequestStart a variable is set for request.user  some
 processing is done and it never really needs to be updated again.  Im
 trying to do  cfif isdefined(request.user) to see if it has been set
 in the onrequeststart but it is never defined.

 As I write this I am guessing the request variable needs to be set each
 time in there to.

 First Page Load --- event.user is set
 Second Page --- check if event.user is set, but I guess it may not carry
 page to page?

 Not sure if I am being clear enough.

 

~|
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:257215
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: cfthrow from onRequestStart / flashagteway

2006-06-27 Thread Andrew Stevens
Thanks for that. I had hoped I could throw the exception back to Flash like
it can be done from methods in other components :(

I'm trying to make use of onError but I'm not sure it fits. How does this
sound: I implemented onError, which now fires when I cfthrow from inside
onRequestStart. 
In onError I can't detect anything about the error I threw because the error
caught is the same Event Handler Exception.

I can cfthrow from onError which will return an error to the Flash client,
but I want to be able to throw specific errors like 'not logged in' (which
is enforced in onRequestStart).

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 27 June 2006 2:22 AM
To: CF-Talk
Subject: Re: cfthrow from onRequestStart / flashagteway 

A CFThrow tosses an error up to the parent of a template. An application.cfc
in some ways acts as the parent of the template but if you do a CFThrow
inside of it when using a gateway, there's nowhere for the error to go other
than the global error handler. Better to call the onError method within the
application.cfc than use a CFThrow. 

Hi would anyone know why I can’t use CFTHROW from within Application CFC
onRequestStart()?

 

I am calling a CFC from Flash via the flashgateway.

 

If I cfthrow I get “06/26 23:07:37 Error [jrpp-3] - Event Handler
Exception.” in Coldfusion.

 

I’m stumped.

 

Thanks.

 

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.4/375 - Release Date: 25/06/2006



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244852
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


cfthrow from onRequestStart / flashagteway

2006-06-26 Thread Andrew Stevens
Hi would anyone know why I can’t use CFTHROW from within Application CFC
onRequestStart()?

 

I am calling a CFC from Flash via the flashgateway.

 

If I cfthrow I get “06/26 23:07:37 Error [jrpp-3] - Event Handler
Exception.” in Coldfusion.

 

I’m stumped.

 

Thanks.

 

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.4/375 - Release Date: 25/06/2006
 


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244774
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfthrow from onRequestStart / flashagteway

2006-06-26 Thread Michael Dinowitz
A CFThrow tosses an error up to the parent of a template. An application.cfc in 
some ways acts as the parent of the template but if you do a CFThrow inside of 
it when using a gateway, there's nowhere for the error to go other than the 
global error handler. Better to call the onError method within the 
application.cfc than use a CFThrow. 

Hi would anyone know why I can’t use CFTHROW from within Application CFC
onRequestStart()?

 

I am calling a CFC from Flash via the flashgateway.

 

If I cfthrow I get “06/26 23:07:37 Error [jrpp-3] - Event Handler
Exception.” in Coldfusion.

 

I’m stumped.

 

Thanks.

 

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.4/375 - Release Date: 25/06/2006

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244783
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: onRequestStart problem with url variables

2006-03-07 Thread Raymond Camden
What do your image source look like? Like this?

img src=dance-pcitures/2005-Bline.jpg

If so, you just need to change it to:

img src=/dance-pcitures/2005-Bline.jpg


On 3/7/06, Les Mizzell [EMAIL PROTECTED] wrote:
 Head scratcher...

 Ok, doing this:

 cffunction name=onRequestStart returnType=boolean output=true
!--- Display our Site Header at top of every page ---
cfinclude template=SiteHeader.cfm
   cfreturn true
 /cffunction

 If I have a link with variable like

 images.cfm?year=2005

 This works exactly like it should. An image on the page will display
 correctly and the path is correct:

 dance-pictures/2005-BLine.jpg

 However, to help pages get indexed I've changed all my URL variables to
   to look like:

 images.cfm/year/2005

 When I do that, view source looks OK on the page, but the path for the
 same image above is now showing as:

 images.cfm/year/dance-pictures/2005-BLine.jpg

 Which ain't right - it's including the full file name into the folder
 path. In fact, all paths on the page are now screwed and nothing
 displays correctly - so I just get an unstyled page of text and nothing
 else.  If I retype images.cfm/year/2005 as images.cfm?year=2005 in
 the address bar, all is right with the world again...

 Ideas of a fix?? This one is a little beyond my head scratching ability...

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234403
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


onRequestStart problem with url variables

2006-03-06 Thread Les Mizzell
Head scratcher...

Ok, doing this:

cffunction name=onRequestStart returnType=boolean output=true
   !--- Display our Site Header at top of every page ---
   cfinclude template=SiteHeader.cfm
  cfreturn true
/cffunction

If I have a link with variable like

images.cfm?year=2005

This works exactly like it should. An image on the page will display 
correctly and the path is correct:

dance-pictures/2005-BLine.jpg

However, to help pages get indexed I've changed all my URL variables to 
  to look like:

images.cfm/year/2005

When I do that, view source looks OK on the page, but the path for the 
same image above is now showing as:

images.cfm/year/dance-pictures/2005-BLine.jpg

Which ain't right - it's including the full file name into the folder 
path. In fact, all paths on the page are now screwed and nothing 
displays correctly - so I just get an unstyled page of text and nothing 
else.  If I retype images.cfm/year/2005 as images.cfm?year=2005 in 
the address bar, all is right with the world again...

Ideas of a fix?? This one is a little beyond my head scratching ability...

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234401
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: onRequestStart problem with url variables

2006-03-06 Thread Les Mizzell
 cffunction name=onRequestStart returnType=boolean output=true
!--- Display our Site Header at top of every page ---
cfinclude template=SiteHeader.cfm
   cfreturn true
 /cffunction
 

 images.cfm/year/2005


OK, I understand what it's doing - the onRequestStart is reading the 
images.cfm/year/2005 as a full link - so maybe my fix is to put my url 
decode script BEFORE the onRequestStart ...

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234402
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: onRequestStart question.....

2006-03-02 Thread Cutter (CF-Talk)
Maybe something like:

cfset variables.fileExclusionList = myFile1.cfm,
myFile2.cfm,
myFile3.cfm,
myFile4.cfm
cfif 
listfindnocase(variables.fileExclusionList,getfilefrompath(cgi.path_translated),,)
 
eq 0
cfinclude template=myHeaderFile.cfm
/cfif


Cutter

Tony wrote:
 might be dumb, but this is what i would do.
 
 cffunction name=onRequestStart returnType=boolean output=true
 cfif NOT (cgi.script_name contains yourFilename1 or
 cgi.script_name contains yourFileName1)
  !--- Display our Site Header at top of every page ---
  cfinclude template=SiteHeader.cfm
  cfreturn true
 cfelse
  !--- DO NOT Display our Site Header at top of every page ---
  cfreturn true
 /cfif
 /cffunction
 
 tw
 
 
 On 3/1/06, Les Mizzell [EMAIL PROTECTED] wrote:
 
I'm using the below to call the header for all the main pages in a site:

cffunction name=onRequestStart returnType=boolean output=true
   !--- Display our Site Header at top of every page ---
   cfinclude template=SiteHeader.cfm
   cfreturn true
/cffunction

Suddenly, I find I've got maybe one of two pages where I do *NOT* want
to call that specific header. Is there a good way to EXCLUDE a page from
using that header, but keep it in the same directory as all the others?


 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233887
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


onRequestStart question.....

2006-03-01 Thread Les Mizzell
I'm using the below to call the header for all the main pages in a site:

cffunction name=onRequestStart returnType=boolean output=true
   !--- Display our Site Header at top of every page ---
   cfinclude template=SiteHeader.cfm
   cfreturn true
/cffunction

Suddenly, I find I've got maybe one of two pages where I do *NOT* want 
to call that specific header. Is there a good way to EXCLUDE a page from 
using that header, but keep it in the same directory as all the others?

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233828
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: onRequestStart question.....

2006-03-01 Thread Tony
might be dumb, but this is what i would do.

cffunction name=onRequestStart returnType=boolean output=true
cfif NOT (cgi.script_name contains yourFilename1 or
cgi.script_name contains yourFileName1)
 !--- Display our Site Header at top of every page ---
 cfinclude template=SiteHeader.cfm
 cfreturn true
cfelse
 !--- DO NOT Display our Site Header at top of every page ---
 cfreturn true
/cfif
/cffunction

tw


On 3/1/06, Les Mizzell [EMAIL PROTECTED] wrote:
 I'm using the below to call the header for all the main pages in a site:

 cffunction name=onRequestStart returnType=boolean output=true
!--- Display our Site Header at top of every page ---
cfinclude template=SiteHeader.cfm
cfreturn true
 /cffunction

 Suddenly, I find I've got maybe one of two pages where I do *NOT* want
 to call that specific header. Is there a good way to EXCLUDE a page from
 using that header, but keep it in the same directory as all the others?

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233836
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cfinclude from a template, or onRequestStart?

2005-11-09 Thread dave
He's not saying to but the actual html in the app.cfc file he's saying put the 
include. And I don't see why you couldn't or wouldn't. I'm doing it on a 
current site and other than a few hair pulls it works great. The main problem 
is that if you have a page you don't want it on then you got a problem. I have 
heard a few ppl say it's not a good idea but they dont explain why not?

here's a quote out of one of the 2 tuts I have read on application.cfc

 onRequestEnd 

This function is called at the end of a page request after all other ColdFusion 
code has executed. If you have application specific logic that should only be 
run at the end of your page, this is the place to put it. The following example 
simply outputs a footer by including the footer.cfm file:  cffunction 
name=onRequestEnd output=Yes returntype=void
   cfargument name=targetPage type=String required=Yes /
   cfinclude template=footer.cfm /
 /cffunction 

So when when ppl say its bad then WHY is it bad, it seems to run just as good 
as any other method.

~Dave the disruptor~
Some people just don't appreciate how difficult it is to dispense wisdom and 
abuse at the same time. 


From: Matthew Walker [EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 9:12 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: cfinclude from a template, or onRequestStart? 

Personally, I wouldn't put any display elements in application.cfc but
rather use it for app setup purposes (defining global variables,
initialising shopping carts, etc). If you wanted to have a different
page template on a page it might be a big hassle -- or one day you may
want a page that delivers RSS or CSV or something else. Depending on the
way your site is structured, you may find custom tag pairs are a nice
way of wrapping templates around your pages

 ...
 ...
 ...

-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 9 November 2005 2:46 p.m.
To: CF-Talk
Subject: cfinclude from a template, or onRequestStart?

I usually assemble my pages with a cfinclude header, menu, footer, etc. 
But I figured it might be better to include the header.cfm in
onRequestStart, and footer.cfm in onRequestEnd to keep from spreading
includes all over the place. 

This way they'd all be in one spot. Am I thinking right??

Thanks,
Will



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223661
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cfinclude from a template, or onRequestStart?

2005-11-09 Thread Matthew Walker
 I don't see why you couldn't or wouldn't

Well you certainly could, although I wouldn't. It is the kind of thing
that may not be a problem now but could be a hassle later. As you
describe in your first paragraph below, it's a hassle when suddenly you
*don't* want that template wrapped around your content for a new page. I
would generally only put things I *always* wanted in
application.cfc/cfm. I couldn't guarantee that anything I was displaying
would be *always* wanted, as I may want a different template for a popup
page, or I may be delivering a different type of content such as XML. 


-Original Message-
From: dave [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 9 November 2005 11:47 p.m.
To: CF-Talk
Subject: RE: cfinclude from a template, or onRequestStart?

He's not saying to but the actual html in the app.cfc file he's saying
put the include. And I don't see why you couldn't or wouldn't. I'm doing
it on a current site and other than a few hair pulls it works great. The
main problem is that if you have a page you don't want it on then you
got a problem. I have heard a few ppl say it's not a good idea but they
dont explain why not?

here's a quote out of one of the 2 tuts I have read on application.cfc

 onRequestEnd 

This function is called at the end of a page request after all other
ColdFusion code has executed. If you have application specific logic
that should only be run at the end of your page, this is the place to
put it. The following example simply outputs a footer by including the
footer.cfm file:  cffunction name=onRequestEnd output=Yes
returntype=void
   cfargument name=targetPage type=String required=Yes /
   cfinclude template=footer.cfm /
 /cffunction 

So when when ppl say its bad then WHY is it bad, it seems to run just as
good as any other method.

~Dave the disruptor~
Some people just don't appreciate how difficult it is to dispense
wisdom and abuse at the same time. 


From: Matthew Walker [EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 9:12 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: cfinclude from a template, or onRequestStart? 

Personally, I wouldn't put any display elements in application.cfc but
rather use it for app setup purposes (defining global variables,
initialising shopping carts, etc). If you wanted to have a different
page template on a page it might be a big hassle -- or one day you may
want a page that delivers RSS or CSV or something else. Depending on the
way your site is structured, you may find custom tag pairs are a nice
way of wrapping templates around your pages


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223717
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cfinclude from a template, or onRequestStart?

2005-11-09 Thread dave
Well there is obviously good and bad to doing it either way. The worse thing so 
far for me is that some pages I dont want the header and footer or like when 
using a text editor it tries to load the header and footer into the textarea. 
But both of those are easily solved by chucking an app.cfc/cfm page in their 
directory and not having the headers/footers there. I'm sure if i was building 
a nasa site I wouldn't do it this way but small sites I see no harm and if 
you do decide to do the rss/xml thingy, it's easy enough to change.

By the way Matthew, you totally rock :)
You always offer good advise!

~Dave the disruptor~
Some people just don't appreciate how difficult it is to dispense wisdom and 
abuse at the same time. 


From: Matthew Walker [EMAIL PROTECTED]
Sent: Wednesday, November 09, 2005 2:33 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: cfinclude from a template, or onRequestStart? 

 I don't see why you couldn't or wouldn't

Well you certainly could, although I wouldn't. It is the kind of thing
that may not be a problem now but could be a hassle later. As you
describe in your first paragraph below, it's a hassle when suddenly you
*don't* want that template wrapped around your content for a new page. I
would generally only put things I *always* wanted in
application.cfc/cfm. I couldn't guarantee that anything I was displaying
would be *always* wanted, as I may want a different template for a popup
page, or I may be delivering a different type of content such as XML. 

-Original Message-
From: dave [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 9 November 2005 11:47 p.m.
To: CF-Talk
Subject: RE: cfinclude from a template, or onRequestStart?

He's not saying to but the actual html in the app.cfc file he's saying
put the include. And I don't see why you couldn't or wouldn't. I'm doing
it on a current site and other than a few hair pulls it works great. The
main problem is that if you have a page you don't want it on then you
got a problem. I have heard a few ppl say it's not a good idea but they
dont explain why not?

here's a quote out of one of the 2 tuts I have read on application.cfc

 onRequestEnd 

This function is called at the end of a page request after all other
ColdFusion code has executed. If you have application specific logic
that should only be run at the end of your page, this is the place to
put it. The following example simply outputs a footer by including the
footer.cfm file: 
returntype=void

  

So when when ppl say its bad then WHY is it bad, it seems to run just as
good as any other method.

~Dave the disruptor~
Some people just don't appreciate how difficult it is to dispense
wisdom and abuse at the same time. 


From: Matthew Walker 
Sent: Tuesday, November 08, 2005 9:12 PM
To: CF-Talk 
Subject: RE: cfinclude from a template, or onRequestStart? 

Personally, I wouldn't put any display elements in application.cfc but
rather use it for app setup purposes (defining global variables,
initialising shopping carts, etc). If you wanted to have a different
page template on a page it might be a big hassle -- or one day you may
want a page that delivers RSS or CSV or something else. Depending on the
way your site is structured, you may find custom tag pairs are a nice
way of wrapping templates around your pages



~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223754
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


cfinclude from a template, or onRequestStart?

2005-11-08 Thread Will Tomlinson
I usually assemble my pages with a cfinclude header, menu, footer, etc. 
But I figured it might be better to include the header.cfm in onRequestStart, 
and footer.cfm in onRequestEnd to keep from spreading includes all over the 
place. 

This way they'd all be in one spot. Am I thinking right??

Thanks,
Will

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223631
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfinclude from a template, or onRequestStart?

2005-11-08 Thread Robert Munn
Depends on who you ask. That is an easy way to handle headers and footers in a 
simple site, but it violates MVC principles, so if you are looking for a 
cleanly separated View, you shouldn't go that route. 

I generally don't bother with MVC for quick and dirty apps or mini-sites, but I 
use a  framework for anything that I plan to maintain and possibly scale 
long-term. It doesn't even matter which framework, really, I just want 
something that separates the different elements of my app. I like Fusebox 3 
with a cfc layer for the model, but it is always tempting in FB3 to pollute the 
fbx_switch file with stuff that doesn't belong there. 

 I usually assemble my pages with a cfinclude header, menu, footer, etc. 
 
 But I figured it might be better to include the header.cfm in 
 onRequestStart, and footer.cfm in onRequestEnd to keep from spreading 
 includes all over the place. 
 
 This way they'd all be in one spot. Am I thinking right??
 
 Thanks,
Will

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223632
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cfinclude from a template, or onRequestStart?

2005-11-08 Thread Matthew Walker
Personally, I wouldn't put any display elements in application.cfc but
rather use it for app setup purposes (defining global variables,
initialising shopping carts, etc). If you wanted to have a different
page template on a page it might be a big hassle -- or one day you may
want a page that delivers RSS or CSV or something else. Depending on the
way your site is structured, you may find custom tag pairs are a nice
way of wrapping templates around your pages

template:normal title=my page
  ...
  ...
  ...
/template:normal


-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 9 November 2005 2:46 p.m.
To: CF-Talk
Subject: cfinclude from a template, or onRequestStart?

I usually assemble my pages with a cfinclude header, menu, footer, etc. 
But I figured it might be better to include the header.cfm in
onRequestStart, and footer.cfm in onRequestEnd to keep from spreading
includes all over the place. 

This way they'd all be in one spot. Am I thinking right??

Thanks,
Will



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223633
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfinclude from a template, or onRequestStart?

2005-11-08 Thread Will Tomlinson
Good points guys! Thanks!

Will

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223634
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfinclude from a template, or onRequestStart?

2005-11-08 Thread Sean Corfield
On 11/8/05, Will Tomlinson [EMAIL PROTECTED] wrote:
 I usually assemble my pages with a cfinclude header, menu, footer, etc.
 But I figured it might be better to include the header.cfm in onRequestStart, 
 and footer.cfm in onRequestEnd to keep from spreading includes all over the 
 place.

 This way they'd all be in one spot. Am I thinking right??

Would you include the header.cfm in Application.cfm and the footer.cfm
in OnRequestEnd.cfm? If the answer to that is no then the answer to
the question above ought to be no as well.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223643
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54