Skip to main content
September 19, 2008
Answered

confusion with cfinclude

  • September 19, 2008
  • 3 replies
  • 388 views
with reference to the tag <cfinclude>, is it correct that if the path given as part of the URL attribute starts with a "/" then the path is assumed to be a coldfusion mapping?
If thats correct then why am I able to see a page within the "test" directory under wwwroot.
I gave this tag:
<cfinclude template="/test/mypage.cfm"> where "test" is in the wwwroot folder.
This topic has been closed for replies.
Correct answer Newsgroup_User
> with reference to the tag <cfinclude>, is it correct that if the path given as
> part of the URL attribute starts with a "/" then the path is assumed to be a
> coldfusion mapping?

No, not quote correct. It'll use a mapping if the path specified in the
template attribute MATCHES a mapping path. Otherwise it'll assume it's in
the webroot (which has a JRUN mapping "/" to it, so I suppose strictly
speaking you are correct, but missing the "/ is a mapping too" part).

What you're seeing is expected behaviour, anyhow.

--
Adam

3 replies

Newsgroup_UserCorrect answer
Inspiring
September 19, 2008
> with reference to the tag <cfinclude>, is it correct that if the path given as
> part of the URL attribute starts with a "/" then the path is assumed to be a
> coldfusion mapping?

No, not quote correct. It'll use a mapping if the path specified in the
template attribute MATCHES a mapping path. Otherwise it'll assume it's in
the webroot (which has a JRUN mapping "/" to it, so I suppose strictly
speaking you are correct, but missing the "/ is a mapping too" part).

What you're seeing is expected behaviour, anyhow.

--
Adam
Inspiring
September 19, 2008
It might be due to the "wwwroot" directory which I believe already mapped in your CFAdmin
Inspiring
September 19, 2008
Hi,

Have you created the required mapping here?.. That is., your logical path as "test" and physical path pointing towards your actual location of directory (i.e, c:\your_directory\test).

Make sure then have a go again.
September 19, 2008
Yes thats exactly what my concern is. I dont have any mapping with the name /test then how is it working?