0
Multiple Application files?
Community Beginner
,
/t5/coldfusion-discussions/multiple-application-files/td-p/425971
Jun 13, 2006
Jun 13, 2006
Copy link to clipboard
Copied
Can you have more a second one in a sub directory?
/appication.cfm
/members/application.cfm
Can this work as long as you give the session a different name?
/appication.cfm
/members/application.cfm
Can this work as long as you give the session a different name?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/multiple-application-files/m-p/425972#M38505
Jun 13, 2006
Jun 13, 2006
Copy link to clipboard
Copied
ColdFusion looks in the current directory for
Application.cfm. If it finds it, it uses it. If it does not find
it, it starts looking up the directory tree until it finds one. It
does not look down to subdirectories.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/multiple-application-files/m-p/425973#M38506
Jun 13, 2006
Jun 13, 2006
Copy link to clipboard
Copied
If you are trying to have "application.cfm" files in
subdirectories jdeline is absolutely correct. ColdFusion will only
execute the first one it comes to in the directory tree. But, I
have seen some coders have a root "application.cfm" file, and then
have multiple "_application.cfm" in various subdirectories. The
underscore at the beginning of the file name will put the file at
the top of the list of files in the directory, and ColdFusion will
ignore the file until you execute it. In the root "application.cfm"
you can have some logic code (i.e., a CFIF statement) you can use
to execute the appropriate "_application.cfm" file when you want it
executed. For example, I've seen some coders have their CFIF
statement look for a directory's name in the CGI.SCRIPT_NAME
variable before it executes a CFINCLUDE for the "_application.cfm"
file located in the desired subdirectory.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
LATEST
/t5/coldfusion-discussions/multiple-application-files/m-p/425974#M38507
Jun 13, 2006
Jun 13, 2006
Copy link to clipboard
Copied
Another way of organizing multiple application.cfm files is
to have one in the root directory with code that you want to always
be executed. Other copies of application.cfm in subdirectories will
contain code specific to their directory and will also, cfinclude
the main application.cfm in the root directory.
This means that the code in root/application.cfm will always get executed and subdirectory-specific code in the subdirectory/application.cfm will only get executed for files in that subdirectory.
This is the approach that I've seen used most often.
This means that the code in root/application.cfm will always get executed and subdirectory-specific code in the subdirectory/application.cfm will only get executed for files in that subdirectory.
This is the approach that I've seen used most often.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

