Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Application Variables vs Request Variables

Explorer ,
Oct 08, 2008 Oct 08, 2008
I've read a number of forums and cf books but they seem to contradict each other.

To me it seems better to put say the datasourcename into the application variable -- but I dont seem able to use #APPLICATION.varname# in my pages (cf8). Am I doing something wrong?

Alternatively #REQUEST.varname# I can use no problem but this to me is requiring the cf server to do unnecessary extra work (ie before each page request) is it not?

Thanks in advance,
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 15, 2008 Oct 15, 2008
Thanks, I have not gotten to needing or even reading up on either mappings (I assume are roadmaps to directories) or customtags but what you say makes sense so I will follow (with gratitude) your suggestions (undoubtedly saving myself hours at some future date).

Similarly though, at the moment I am defining an APPLICATION.imageSource = " http://70.69.etc " with the thought to store my images on a separate server later on (maybe Amazon S3 or the like). Is this the sort of thing better done via an application.mapping ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2008 Oct 15, 2008
LATEST
ProjectedSurplus wrote:
Similarly though, at the moment I am defining an APPLICATION.imageSource = " http://70.69.etc " with the thought to store my images on a separate server later on (maybe Amazon S3 or the like). Is this the sort of thing better done via an application.mapping ?

If the imageSource URL is a constant throughout the application, then it's a good idea to set APPLICATION.imageSource = " http://70.69.etc " in onApplicationStart. I expect the struct, application.mappings, to have keys whose values correspond to the mappings you defined in the Coldfusion Administrator.



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources