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

confusion with cfinclude

Guest
Sep 19, 2008 Sep 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?
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.
TOPICS
Getting started
359
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

correct answers 1 Correct answer

LEGEND , Sep 19, 2008 Sep 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 expec...
Translate
Advocate ,
Sep 19, 2008 Sep 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.
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
Guest
Sep 19, 2008 Sep 19, 2008
Yes thats exactly what my concern is. I dont have any mapping with the name /test then how is it working?
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
Advocate ,
Sep 19, 2008 Sep 19, 2008
It might be due to the "wwwroot" directory which I believe already mapped in your CFAdmin
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
LEGEND ,
Sep 19, 2008 Sep 19, 2008
LATEST
> 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
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