Hello everyone,
I decided to include an example zip file, since I cannot express myself very
well on email about the problem. I am trying to understand the proper usage
of request variables. I followed a thread that Dave Watts uses request
variables as constants that normally do not change. Actually that is
exactly how I am using them but at times my request variables would become
undefined. I don't understand why! When do request variables become
undefined.
There was also a thread mentioning that request variables are only
persistent between page to page via the usage of cfincludes and cfmodules.
I really don't understand this.
Please inform if including a zip file is improper usage of the mailing list.
I do not know the dos and don'ts of using the list other than absolutely no
SPAM emails.
By the way, you would need to create a alias '/test' as the logical
directory with CF Administrator and a Virtual directory '/test' on the PWS.
Justme
Kinley
-----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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists