2 Replies Latest reply on Oct 2, 2015 2:24 AM by BKBK

    cfapplication and this.mapping for component

    thnguyen Level 1



      Sorry to ask but I am struck and don't know where to go on.  Any suggestions are appreciated. Here is the structure of the site.  All the components are inside the components directory.  With et directory, I'd like to create an Application.cfc for that.  Files in et directory will call up functions in components directory.  I tried to create this.mappings in et Application.cfc but don't seem to recognize or work.  What do I need in sub Application.cfc (et folder) to call components?


      Application.cfc (root application.cfc)

      -components folder

      -ce folder

      -et folder

           - Application.cfc




      With the root Application.cfc, it has the following:

      <cfcomponent displayname="Application" output="true" hint="Handle the application.">


      <!--- set up per application mappings --->

        <cfset this.mappings = {}>

        <cfset this.mappings["/components"] = GetDirectoryFromPath( GetCurrentTemplatePath() ) & "components">

        <cfset this.mappings["/ce"] = GetDirectoryFromPath( GetCurrentTemplatePath() )>


          <!--- Set up the application. --->

          <cfset THIS.Name = "Test" />

          <cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 1, 0, 0 ) />

          <cfset THIS.SessionManagement = true />

          <cfset THIS.SessionTimeout = CreateTimeSpan( 0, 1, 0, 0 ) />

          <!---<cfset THIS.SetClientCookies = true />--->

          <cfset THIS.SetClientCookies = false />

          <cfset THIS.loginstorage="Session">