So, if I assigned a value to a "request.site.webroot" variable in
app_globals, will this variable be available at anytime throughout all the
templates in any directory?  I ask this question because I am having error
messages where the variable is not recognized.

It was made mentioned that request scope variables are only used from page
to page using cfincludes and cfmodules.  I am not sure what this means.
Does this mean that I can use request variables only to past values?

The fusebox methodology book seems to indicate to use the request variables
as though they are global variables but I am getting these unrecognized
variable messages.

Actually, I am also having problems with session variables.  At times, I
scratch my head wondering why I would have unrecognized session variables at
times.  It may be recognized on one page but immediately not on another.
Whether the page is in the same directory or not.

Confused....

Justme  JustLearning  Just a Coldfusion wantabie

Kinley Pon
Westcar Consulting Group, Inc.
mailto: [EMAIL PROTECTED]


-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 04, 2000 8:35 PM
To: CF-Talk
Subject: RE: Application.cfm

> In your application
> <cfset application.variablename = "variable">
>
> In your custom tag
> #application.variablename#
>
> Scoping it as request.variablename is BAD! The request scope
> is set for each PAGE request and is not the same thing as
> application scope. Before I figured out my application scoping
> problem I set everything to request scope only to have to go
> back and change it later. This is a big performance issue if
> you run a big site.

I wouldn't go so far as to say that using the Request scope is bad. However,
it's not a replacement for the Application scope. Each is appropriate for
different things.

The Request scope is good for constants - variables which won't change their
values over the lifespan of the application, and which are created with
simple CFSETs. The cost of recreating them for each page is minimal. You
wouldn't want to use the Request scope to store data objects like recordsets
and arrays, though, unless you wanted to discard them at the end of
processing for all scripts building a response to a single request.

The Application scope is good for persistent values which may change over
the lifespan of the application.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to