I have in index.cfm which includes a test include.cfm file using a CF mapping.
But instead of including the include.cfm the index.cfm includes itself.
Here's my mapping, which points to the webroot:
[b]/testmapping1
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-something-/ [/b]
The contents of the webroot:[b]
[bdawson@cfusion-tng -wvr-en-something-]$ pwd
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-something-
[bdawson@cfusion-tng -wvr-en-something-]$ ls -l
-rwxrwxrwx 1 bdawson likewise 59 Apr 2 09:53 Application.cfc
-rwxrwxrwx 1 bdawson likewise 59 Apr 2 09:53 include.cfm
-rwxrwxrwx 1 bdawson likewise 301 Apr 2 10:26 index.cfm
[/b]
Application.cfc and include.cfm both contain the following:[b]
<br>>>><br>
<cfoutput>#getcurrenttemplatepath()#</cfoutput>
<br><<<<br>[/b]
index.cfm has:[b]
<cfoutput>
<cfparam name="request.counter" default="0">
<cfset request.counter = request.counter + 1>
<cfif request.counter GT 3>
<br>Aborted in #getcurrenttemplatepath()# to prevent infinite loop
<cfabort>
</cfif>
<br>>>><br>
#getcurrenttemplatepath()#
<br>
<cftry>
include #request.counter#: <cfinclude template="/testmapping1/include.cfm">
<cfcatch><cfdump var="#cfcatch.message#"></cfcatch>
</cftry>
<br><<<<br>
</cfoutput>
[/b]
And here's the output i get:
[b]
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/Application.cfc
<<<
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
include 1:
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
include 2:
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
include 3:
Aborted in
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm to
prevent infinite loop
[/b]
It looks like the file is being not found, but in stead of throwing an
exception it is including the index.cfm
If I change the cfinclude to be <cfinclude
template="testmapping1/include.cfm"> then it throws a file not found exception
as expected.