railo application.cfc this.mappings not working

后端 未结 2 1738
春和景丽
春和景丽 2021-01-14 15:15

i am using the latest version of railo, and am trying to get the per-application mappings to work. this is what i am doing:



        
2条回答
  •  醉梦人生
    2021-01-14 15:16

    Your syntax is OK, I've just did the same for application deep in directories tree and it works fine.

    however, my components cannot be accessed by this mapping,

    What is exact error? "invalid component definition, can't find myapp.xyz"?

    Are your cfm and cfc in the same directory? (this is basically what you are trying to do)

    and when i do a cfdump on the application variable in my code, it will show that the "applicationname" is set to "MyApp", but nothing shows for the mappings.

    You wont see this info by dumping the application scope. Only option is to use Application.cfc as usual cfc.

    
    
    

    EDIT. You have two solutions here.

    Define mapping like this, so path will be calculated for Application.cfc:

    
    

    Or change component path like this:

    
    

    Problem is in differences between paths returned by ExpandPath and getCurrentTemplatePath().

提交回复
热议问题