5 Replies Latest reply: Jul 7, 2010 3:35 AM by Owain North RSS

    Simple cfc mapping issue = I am a muppet

    Owain North Community Member

      Right, there's something blissfully simple that I'm just missing here, but I've had by C# hat on for weeks and now have had to come back to CF and I've gotten stuck on a simple issue.

       

      Yes, I've trawled Google and the search on here but I just can't spend any more time on this, so thought I'd post on here so someone can abuse my noobishness.

       

      All I want is a simple mapping to a cfc directory for creating components. In order to avoid issues with mappings coinciding with physical directories, I've made them a little more unique but still nothing. My folder structure is currently thus (simplified):

       

      /htdocs

        /badgers

          Something.cfc

        /quotenew

          index.cfm

       

      What I want to do is to create an Application-level mapping (ie not in CF admin) to the cfc directory. My Application.cfc has the following lines at the top:

       

      THIS.Mappings                = {} ;
      THIS.Mappings["horses"] = 'badgers' ;

       

      Then in /quotenew/index.cfm I have the following line:

       

      <cfset a = createObject("component","horses.Something") />


      But I'm getting the dreaded "Could not find the ColdFusion Component or Interface horses.Something." error.

       

      I've tried everything I can think of but just can't figure out whether I've done something stupid or whether it would never work in the first place but as I said, I'm well out of practise. If anyone can point me in the right direction, I'd be most appreciative.

       

      O.