Wednesday, April 05, 2006

Missing Template Handler in ColdFusion MX 7

Setting up the missing template handler in ColdFusion MX 7 and actually getting it to work correctly is a little more involved than most would think. Here are the steps to get it set up correctly, and some details that aren't very apparent.

  • Open the ColdFusion MX 7 Administrator.
  • Determine what error handler should be used.
    I needed to setup the missing template handler for http://localhost/client1/. This meant that I needed to use /client1/common/error.cfm as my missing template handler value. The ColdFusion Administrator states to use a relative path, but this is really an absolute path from the webroot (this applies to the site-wide error handler as well).
  • Create a ColdFusion Mapping for this virtual directory.
    While attempting to do the above, the administrator kept telling me that the site wide administrator does not exist. To rectify this, you need to temporarily setup a ColdFusion mapping with the following attributes.
    Logical Path: /client1
    Directory Path: [insert path to 'client1' folder here]
  • Go back to the settings page and hit save. The CF Administrator shouldn't have an issue with your handler at this point in time.
  • You then need to setup your website or virtual directory in IIS so that it knows to use the CF 404 page, and that it needs to check for missing files.
    Please see http://www.macromedia.com/go/95ee04fb for more information.
  • Restart IIS and CF and everything should be working.

Items to note:

  • Once you setup IIS to check for files, 404 error messages will no longer be logged by ColdFusion. I'm assuming this is because IIS supercedes CF when it comes to 404 errors when configured similar to above.
  • When following these instructions, the error handler stays in effect even if the missing template handler is removed from the CF Administrator.
  • The ColdFusion Mapping that is required in order to successfully validate the Missing Template Handler value can be deleted once the handler is in place and accepted by the CF Administrator.

No comments:

Post a Comment