Thanks Charlie and Teddy! Sorry for the delay.

I tried your suggestions and moved my page-not-found.cfm to the root of my 
website and also wrote a simple onError event handler in my application.cfc: 

 <cffunction name="onError" returntype="void">
  <cfargument name="Exception" required=true/>
  <cfargument name="EventName" type="String" required=true/>
  in Application.cfc: onError
 </cffunction>

Unfortunately, this doesn't change anything: page-not-found.cfm is executed 
correctly as long as I don't read any application vars, but throws a "core" 
file not found error when I do. It seems the onError event is never fired at 
all. BTW, in IIS I have set the 404 error page to also point to 
page-not-found.cfm. This page IS executed correctly, including a read from an 
application var when a user requests anything but a cfm file.

The CF application log shows 3 lines:

Exception thrown by error-handling template:
Element SITEROOT is undefined in APPLICATION. The specific sequence of files 
included or processed is: D:\mysite\Page-not-found.cfm
File not found: /mysite/catal.cfm The specific sequence of files included or 
processed is: d:\mysite\catal.cfm

Mischa.




> Might it be that your page-not-found.cfm is located at a directory level
other than where your code live? In which case it may not benefit from the
application.cfm you'd have there, which is doing the CFAPPLICATION tag that
enables the application scope?

If that's the case, either move the page-not-found.cfm into the same
directory as code you expect to have those variables or put a CFAPPLICATION
with the same NAME into the page-not-found.cfm or an application.cfm in its
directory or parent. Hope that helps.

/charlie

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mischa
Uppelschoten ext 10
Sent: Friday, May 05, 2006 2:26 PM
To: [email protected]
Subject: [ACFUG Discuss] Missing template handler does not have access to
application scope?

Trying to get "page-not-found.cfm" as a missing template handler to work in
CFMX7.

When I request a non existing cfm page foo.cfm this code in
page-not-found.cfm is executed fine:

<cfset request.txt="Page not found">
<cfoutput>
#request.txt#
</cfoutput>

This does not work fine:

<cfset request.txt="Page not found">
<cfoutput>
#request.txt#
</cfoutput>
<cfdump var="#application#">


CF will display the text "Page not found" in the browser, but will then
generate the default "Error Occurred While Processing Request", complaining
that the foo.cfm file could not be found. I rely on my application variables
for displaying my standard site layout, so at this moment I'm unable to
properly format a page not found error. Any suggestions?
Thanks!
Mischa.


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




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



<



Mischa Uppelschoten
The Banker's Exchange, Inc.
2020 Hills Avenue NW
Atlanta, GA  30318

Phone:    (404) 605-0100 ext. 10
Fax:    (404) 355-7930
Web:    www.BankersX.com
Follow this link for Instant Web Chat:
http://www.bankersx.com/Contact/chat.cfm?Queue=MUPPELSCHOTEN


--------------------------------------------------------
* 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