Archive for February, 2003

Couple of Useful Custom Tags

It was pointed out the other day on a list that cfinclude doesn’t let you include JSP pages and that there is no cfforward tag to forward a request on to another resource (CFM, JSP, servlet, etc.). BlueDragon apparently does have this functionality. Well, now ColdFusion does, too, with the extremely simple tags below. And ColdFusion also has getPageContext(), as well.

The includeanything tag will include any type of page, not just a
CFM template.

@attribute page (required) Relative path to the template you want
to include.
<cfif thisTag.executionMode is "start">
<cfparam name="" />

The forward tag will perform a server-side redirect.

@attribute page (required) Relative path to the template you want
to forward to.
<cfif thisTag.executionMode is "start">
<cfparam name="" />

Macromedia Public Bugbase?

Macromedia has been contemplating the idea of a public bugbase for its products. I have two questions:

  1. Is this something the ColdFusion development community would consider useful? If so, why?
  2. Does anyone know of any other companies who have public bugbases for their products (not open source projects)? If you have used them, how useful did you find them to be?

cfform Work-around

There was some discussion on cf-talk today about getting cfform to work with CFMX for J2EE. The problem is that the cfform.js file does not get loaded properly. The work-around is to do one of the following three things:

  1. Copy the cfform.js file out of the CFIDE/scripts directory into some directory in your webroot and use the scriptSrc attribute of the cfform tag to reference it.
  2. Create a symbolic link in your webroot that points to to the cfform.js file in the CFIDE/scripts directory (Unix only) and reference it using the scriptSrc attribute of the cfform tag.
  3. Create a mapping in the administrator to the cfform file.

Tons of New DevNet Content

Macromedia released about 20 new DevNet articles yesterday. They don’t cover ColdFusion, but they are relevant to web development in general.

Setting Up Your PHP Server Environment Using Linux, Apache, MySQL, and PHP
David Sklar

Setting Up PHP for Microsoft IIS Web Server
Andrew Stopford

Setting Up PHP, MySQL, and Apache on Mac OS X for Dreamweaver MX
Minh Huynh

PHP Server-Side Graphics with Dreamweaver MX
Gareth Downes-Powell, Tim Green, Allan Kent, Bruno Mairlot, George McLachlan, Dan Radigan, Glasshaus

Many to Many Insert Form with ImpAKT2

Building a Dynamic Website with Dreamweaver MX and PHAkt

Introduction to ASP.NET Web Form Controls
Ryan Parnell, Joel Martinez, Macromedia Press

Effectively Using Web Form Controls
Ryan Parnell, Joel Martinez, Macromedia Press

Creating an ASP.NET User Control
Jonathan Quint, Macromedia Instructor-Led Training

Graphing with .NET and the Dreamweaver MX Data Layer
Joel Martinez

Implementing Forms-Based Authentication
Heidi Bautista

Clydes Online-Macromedia Flash and E-Commerce
Ryan Thomas, Shea Gonyo

LOGGED IN: Dreamweaver MX: Supporting the PHP and ASP.NET platforms
George Fox

JD’s Forum: “My Way, or the Highway!!” Technological Tolerance and Rigid Belief Systems
John Dowdell

Controlling Button States: Template Parameters and Expressions
Murray Summers, Brad Halstead

Using Parameters and Expressions to Make a Breadcrumb Trail
Murray Summers, Brad Halstead

Embedding Macromedia Flash While Supporting Standards
Drew McLellan

Winter Olympics: Multimedia Created in Director
Dean Utian

Take Control of Connections
Kristopher Schultz

DevNet Professional EULA Summary

I saw some questions on a mailing list about the DevNet Professional End User License Agreement (EULA). I finally got a chance to discuss it in detail with the right people at Macromedia, and basically what it comes down to is that the servers included with DevNet Professional are only meant for you to experiment and develop with. The term “testing” in the EULA is meant to describe the kind of testing that naturally occurs during development. You can let your QA team test software against your development environment and you can demo your software to clients on your development environment, but you can’t install the server software on additional machines specifically for QA testing, load testing, or software demos. If you want to have a separate set of servers for QA testing, load testing or software demos, you have to purchase additional licenses. Anyone who uses the servers in a development capacity (in other words, anyone who directly accesses source code) must be a DevNet Professional subscriber.

You can find more information about DevNet licensing here:

You can find the entire DevNet EULA here:

Three New TechNotes

Macromedia releases 3 new Tech Notes on ColdFusion MX:

ColdFusion MX fails to start with a HotSpot Virtual Machine error:

ColdFusion MX: Configuring the Default-error and Default-out log files:

Installation wizard does not give option to configure available web servers:

Don’t Forget About “contains”

I have seen several people use functions like find, findNoCase and findOneOf to search strings for substrings. Don’t forget about the “contains” comparison operator. It lets you do things like this:

<cfif string1 contains string2>
It's in there.

… as opposed to …

<cfif findNoCase(string1, string2) neq 0>
It's in there.

Keep in mind that “contains” does not compare case.

Big Blogging News

I guess everyone knows about Google buying Pyra Labs by now. If not, you can read about it here:

Now Microsoft is getting in on the action, as well. Read about their new product here:,4248,894255,00.asp

Not to be left behind, AOL is talking about blogging, as well:

Why Use cftry and cfcatch?

Someone on a mailing list asked today for an explanation of cftry and cfcatch, and examples of when to use them. Although I don’t think it ever made it to the list (the server seems to be down), this was my response:

I have found the try/catch framework to be most useful in two circumstances:

  1. When your code could encounter an error that you either expect or can recover from, you can trap and handle it with cftry and cfcatch. For instance, I wrote some code recently that checks if a specific file exists on the file system. If it does, the file gets included, but if it doesn’t exist, I just include another file that I know will exist. I put a cftry and cfcatch around the include code to accomplish this.
  2. If you want to add more information to an error. At any particular point in your code, you usually know more about the code than the CF server would if it were to throw an error at that particular point. Usually, that’s fine because the chance of an error being thrown is very small, or the additional information you have would not necessarily be useful in fixing the error, however sometimes you might want to include this additional information in the even of an error. For instance, if you are trying to include a page with a URL from a database, rather than just hoping that the page exists or letting ColdFusion formulate an error message if it is not there, you might wrap your cfinclude in a try/catch block, then re-throw the error (assuming you have no way to recover from it) with an additional message explaining that the URL that was retrieved from the database (might even include database information like the data source and the query) is out of synch with the file system.

(OT) Footage of Extreme Weather on Presidents’ Day

These are some pictures I took around my neighborhood today. We got about 30 to 32 inches of snow here which kept me pretty busy Sunday and Monday. We shoveled until we ran out places to put the snow. My street has still not been plowed, so nobody is going anywhere for a while.