So the bottom line you're finding is that when you request a non-existing
CFM page, the application.cfc does not run. Sounds like either a bug or an
undocumented behavior. Thanks for clarifying that you're only using
application.cfc and not application.cfm. Since it's newer, it may well have
a bug. Unless someone else recognizes something here, sounds like something
to take to Adobe. You seem to have a pretty clear demonstration now.

As for your last comment, "application vars are loaded in the memory of the
CF server when the application starts, so my application.cfc shouldn't even
*have* to be loaded for them to be available during every page request,
right?", well yes and no. Yes, if the application.cfc had been executed
commensurate with this request, then yes the vars would be there (assuming
no timeout, of course). 

But if a page doesn't execute the application.cfc (or doesn't run
application.cfm/CFAPPLICATION to connect to a given application), then there
is no connection between the request for that page and any previously
created "application scope". It's always there in memory, but a page
connects to it by either running application.cfc or a given
application.cfm/CFAPPLICATION tag.

One last thought: if you were using application.cfm, I would have suggested
that a work-around is to simply CFINCLUDE the application.cfm in your page
(perhaps using an admin mapping to help locate it from wherever in your app
a requested page may live). With application.cfc, I don't know if the same
notion exists: could you invoke it manually? May be worth a try, at least
while you await a reply on its automatic processing.

Hope that helps.


/charlie

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mischa
Uppelschoten ext 10
Sent: Wednesday, May 10, 2006 11:44 AM
To: discussion@acfug.org
Subject: re[4]: [ACFUG Discuss] Missing template handler does not have
access to application scope?

Thanks Charlie, let me answer your questions below. (long answer warning!)


> Mischa, when your first note mentioned you were use this "as a missing
template handler", I assumed that you were referring to the Admin console
configurable setting. 
** Correct, CF admin -> Server Settings -> Settings -> Missing Template
Handler.


Now you mention using the application.cfc.
** That was Teddy's suggestion. Since I'm in the dark on this issue, I'm
trying everything folks tell me ;)

 I just want
to make sure that these are unrelated in your mind (as I don't believe that
the application.cfc does missing template handling, just as CFERROR does
not). 
** From what I can see, you're right.

Also, the existence of application.cfc prevents application.cfm running,
doesn't it? So you want to remove that if it was just some kind of test.
** If I understand correctly, it is suggested to use application.cfc instead
of application.cfm on MX7, which is what I have been doing. I have never had
an application.cfm.


So, just to be clear, you are confident that the error handler is being
triggered by the admin setting pointing to it, but when it does it fails if
you refer to an application variable.
** Positive.

 That would seem to suggest that it
simply isn't running the application.cfm. It should, I'd think, but I don't
know for sure.

First things first: if you enable debugging, do you in fact see that it does
not run the application.cfm?
** Ok, I think there are 4 situations:
1. request non-existing html file, request app var: application.cfc is
executed, app var is returned, page-not-found.cfm executed properly.
2. request non-existing html file, do not request app var: application.cfc
is executed, app var not requested, page-not-found.cfm executed properly.
3. request non-existing cfm file, request app var: application.cfc is not
executed, app var is not returned, page-not-found.cfm does not execute
properly.
4. request non-existing cfm file, do not request app var: application.cfc is
not executed, app var is not requested, page-not-found.cfm executed
properly.

BTW, I'm relying on the Execution Times section of my debug window to
determine whether application.cfc is executed or not.



If it's still not clear, rather than dump the application scope (as you did
in your original note), try dumping the variables scope (<cfdump
var="#variables#">) Assuming you have no other vars being set in the error
handler, you should see a dump of the empty variables struct. Then, in the
application.cfm, do a <cfset name="bob">, and rerun the request, to see if
the CFDUMP now shows the variable. 
** Ok, I added this extra variable in a cfset to my application.cfc ->
onRequestStart  and restarted the CF service.

If it doesn't, then it clearly isn't
running the application.cfm.
** When I do <cfdump var="#variables#"> as a first thing on
page-not-found.cfm scenario 1: struct [empty], app var is outputted, extra
var is not dumped scenario 2: struct [empty], extra var is not dumped
scenario 3: dump of the CFERROR and ERROR structs (nothing else) and then
the core file not found error, extra var is not dumped scenario 4: dump of
the CFERROR and ERROR structs (nothing else), extra var is not dumped

The thing that I don't understand: application vars are loaded in the memory
of the CF server when the application starts, so my application.cfc
shouldn't even *have* to be loaded for them to be available during every
page request, right?

Hope this helps!
Mischa.




Maybe someone else can tell if this jibes with their experience. I just
hadn't noticed before (and can't at the moment set up tests to confirm). 

/charlie



--------------------------------------------------------
* To unsubscribe from this list, manage your profile @ *
* http://www.acfug.org?fa=login.edituserform           *
*                                                      *
* For more info, see http://www.acfug.org/mailinglists *
--------------------------------------------------------


Reply via email to