ColdFusion Application.cfc - order of execution

前端 未结 5 550
旧巷少年郎
旧巷少年郎 2021-01-05 00:34

I need a reality check - and hopefully an explanation (if my reality is wrong).

The way the CF application framework evaluates things is this (my understanding) - re

5条回答
  •  一生所求
    2021-01-05 01:25

    the application scope is not available in the Application.cfc pseudo constructor, because until this.name has been set there is no way to tie the request to the application.

    If you are worried about the overhead of creating your apps mappings, one approach would be to cache them in the server scope which is available.

    if(!structkeyexists(server, 'myappmappings')){ server.myappmappings = createMappings(); } this.mappings = server.myappmappings;

    you might also be able to use cachePut/cache Get to store the mappings in ehcache, but I've not tried that in the pseudo constructor.

提交回复
热议问题