Skip to main content
Inspiring
April 21, 2012
Answered

THIS.mappings - scoping problem?

  • April 21, 2012
  • 1 reply
  • 1120 views

hi there

our Application.cfc contains

  THIS.mappings = StructNew();

  mappingname = "/webincludes";

  mappingpath = "Z:\webincludes\movo";

  THIS.mappings[mappingname] = mappingpath;

Calling

    <cfinclude template="/webincludes/vowiz/myinclude.inc" >

from within the function onRequestStart() works fine.

But when we try to do the same from a normal cfm-template, we get a

   Could not find the included template /webincludes/vowiz/myinclude.inc

Is this a scoping problem? And how can we overcome it? I actually thought, that mappings are visible all over the application?

-Didi

    This topic has been closed for replies.
    Correct answer Didi3

    you may just trash this thread !!!!

    For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

    before the cfinclude - who wonders it has forgotten the mappings

    Sorry for bothering, unfortunately I cannot delete the thread - maybe an admin will do so. It's not worth to keep.

    -Didi

    1 reply

    Didi3AuthorCorrect answer
    Inspiring
    April 22, 2012

    you may just trash this thread !!!!

    For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

    before the cfinclude - who wonders it has forgotten the mappings

    Sorry for bothering, unfortunately I cannot delete the thread - maybe an admin will do so. It's not worth to keep.

    -Didi

    Inspiring
    April 22, 2012

    For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

    before the cfinclude - who wonders it has forgotten the mappings

    Didi, was it you that was asking about source control the other week?  This is another case in point wherein using source control & separate working copies rather than just hacking the code directly is beneficial: your co-worker can mess up the code as much as they like, and provided they don't commit their mess (at which point you're allowed to shoot them ;-), their mess does not affect you.

    --

    Adam

    Didi3Author
    Inspiring
    April 22, 2012

    Hi Adam

    yes, that was me.

    However, in this case SC would not have been successful. He was working all on his own on that part of the project and just asked me for help. I did not see the flaw at the first view.

    But we have heard the bells and are looking into SC

    -Didi