And as long as we’re sharing tips for you as a newcomer to CF (and 
application.cfm/cfc in particular), note that CF’s process of working with them 
is to run any in the directory of the page being called, and if not found to 
look in the directory above that, and so on, all the way to the root—not of the 
site but of the drive. That is changeable as of CF9 (a server-wide setting in 
the CF Admin).

As for the plethora of such files seeming unusual, I’ll note that there are 
similar (though not equal) concepts in asp (global.asa), .NET (global.asax and 
web.config), j2ee (filters), and so on. CF’s application.cfm is among the 
oldest, and really acted as an “onrequeststart” filter: code to run when a 
request starts. In fact, a few years later they added literally 
onrequestend.cfm as its corollary. Then in CF7 they added the application.cfc, 
which instead defined many methods, among which were an onrequeststart and 
onrequestend (as well as onerror, to get back to your original question.)

BTW, be aware that there is also server-wide error handling, for those apps 
that don’t setup their own error handling. And there is also try/catch 
handling, to fine-tune error handling within specific code (rather than the 
whole application). Indeed, it’s really a nesting of error handling that CF 
offers, where you can catch them at the most inner level, and if not there then 
at the next outer level, and so on. I expanded on that (and error handling in 
general) in a series of articles for the old CF Dev Journal. Though from about 
10 years ago, most of the concepts still apply (though it was before CF7 so no 
reference to app.cfc), starting at:

http://www.carehart.org/articles/#2000_10

Hope that helps.

BTW, as for that gobbledygook you saw, Mark noted that it “looks like it might 
be encrypted.” To be clear, there is a feature in CF (a command line tool 
called cfencode.exe, in [cf]\bin) that can make code not human readable. Note 
that it’s “cfencode” and not “cfencrypt”. Some do still refer to it as 
encryption, but it really is just an encoding (that can be broken), so the tool 
was renamed to “cfencode” several years ago to connote that. (For those 
interested, CF7 did add support for precompiling templates, which for the most 
part cannot be reverse-engineered back to source. See [cf]\bin\cfcompile.bat 
and the CF documentation.)

 

/charlie

 

From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of axunderw...@ups.com
Sent: Friday, March 11, 2011 3:35 PM
To: discussion@acfug.org
Subject: RE: [ACFUG Discuss] Error Handling and CF8

 

Well, here's a quick tip for you - you mentioned you only searched for 
Application.cfm files, you might want to include Application.cfc to that 
search.  Application.cfc is the "newer" version of Application.cfm and has many 
more events that can be handled at page/application load times.  You might have 
several of those floating around where you'll want to put in your error 
handling.

 

  _____  

From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of Matthew Nicholson
Sent: Friday, March 11, 2011 3:31 PM
To: discussion@acfug.org
Subject: RE: [ACFUG Discuss] Error Handling and CF8

Excellent point!

 

I’ll admit, I’m still quite new to working with CF and coming behind a number 
of developers onto a project with a less than ideal documentation policy… well… 
you get the idea… :)

 

Thankfully, I love a good challenge. :D

 

Matthew R. Nicholson

 

From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of axunderw...@ups.com
Sent: Friday, March 11, 2011 3:25 PM
To: discussion@acfug.org
Subject: RE: [ACFUG Discuss] Error Handling and CF8

 

:-)

 

That's not uncommon...each Application.cfm or Application.cfc can be used for 
separate applications, or can be used to help keep directories from being 
secured, etc.  It's just part of the CF framework - wouldn't call it a mess 
just because there's multiple of them!  Might be that it is a mess, but, 
multiple Application files definitely have their place.

 

Allen

 

  _____  

From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of Matthew Nicholson
Sent: Friday, March 11, 2011 3:22 PM
To: discussion@acfug.org
Subject: RE: [ACFUG Discuss] Error Handling and CF8

Ah Ha!

 

Looks as though I was barking up the wrong Application.cfm… 

 

I’ve found one that’s not encrypted and is apparently being used by my 
application mixed in all the source that I hadn’t noticed before.

 

How many of these “Application.cfm” files are typically built into a single CF 
server? Oddly enough, I’ve found about 8 on this box. What a mess…

 

Matthew R. Nicholson

 

From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of Mark Bureau
Sent: Friday, March 11, 2011 3:17 PM
To: discussion@acfug.org
Subject: Re: [ACFUG Discuss] Error Handling and CF8

 

looks like it might be encrypted. 

 

From: Matthew Nicholson <mailto:matthew.nichol...@soltech.net>  

Sent: Friday, March 11, 2011 3:08 PM

To: discussion@acfug.org 

Subject: [ACFUG Discuss] Error Handling and CF8

 

Afternoon All!

 

I’m trying to setup error handling for our production environment to be more 
sophisticated then explosion followed by a crash and burn.

 

With that, I’ve been able to find a wealth of tutorials on how to set templates 
and all sorts of other goodies but a majority of them require me to modify the 
Application.cfm or Application.cfc.

 

My server(s) are all running vanilla CF8 and only use the Application.cfm. 
However, I’m unable to modify the file, I get a whole bunch of goop (with an 
example below) when I attempt to modify the file in just about every editor I 
have access to.

 

Example:  

  _____  

N 

  _____  

P 

  _____  

¶¢**´ 

 

Is it encrypted? Am I being thick? Any direction would be greatly appreciated 
as always!

 

Thanks!

 




-------------------------------------------------------------

To unsubscribe from this list, manage your profile @ 

http://www.acfug.org?fa=login.edituserform



For more info, see http://www.acfug.org/mailinglists

Archive @ http://www.mail-archive.com/discussion%40acfug.org/

List hosted by http://www.fusionlink.com

-------------------------------------------------------------


Reply via email to