ColdFusion Developer Week 2012

Adobe's second ColdFusion Developer Week kicks off today, June 4, and continues through Friday, June 8, 2012. Whether you're a new or experienced CFML developer, there's probably more than one session you'll find very interesting and useful. From basics to advanced language features, as well as frameworks and a focus on the new ColdFusion 10 release, there's just loads of good stuff, all provided via free online Webinars.

Check out the sessions and schedule, and sign up.

Like last year, I'll be presenting Improve Your Apps Through Unit Testing, tomorrow.

I also hope to revive this sleepy blog with some more interesting tid-bits soon, so stay tuned! It's been a busy year, but I've queued a number of topics for blog posts, so hopefully I can catch up a little in the near future.

CFML on Tomcat via Apache AJP Proxy, Redux

I often use Tomcat as my servlet container to power my CFML apps (works great for ColdFusion, Open BlueDragon and Railo!). I've been perfectly happy with the power and flexibility of using Apache HTTPD's mod_rewrite with an AJP proxy, as Sean Corfield has detailed. Then, after repeating a lot of rewrite rules in all of my virtual host definitions, I decided to merely place the following in my main Apache configuration file:

<Proxy *>
Allow from
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2

That's it! Now, any Apache virtual hosts for CFML application can be defined as simple as this:

<VirtualHost *:80>
ServerName myrockinapp
DocumentRoot /var/www/myrockinapp
DirectoryIndex index.cfm

I can still easily add URL rewriting to my Apache virtual hosts. For example, when using Mura CMS I often set the properties siteIdInURLs=0 and indexFileInURLs=0 to make super clean looking URLs (with no siteID or index.cfm in the URLs). This then of course requires a rewrite rule to ensure the proper requests are passed to Tomcat, which is as simple as adding these lines to your virtual host (or an .htaccess file in your Web root):

RewriteEngine On
RewriteRule ^([a-zA-Z0-9/-]+)$ /index.cfm%{REQUEST_URI} [PT]

Makes all the configuration I used in this post look a bit silly now :P

Also, if you're interested in a clean, production-worthy server setup running on Ubuntu 10.04 with Railo, Tomcat, Apache and MySQL, I have this fairly well documented in this Google Doc.

cf.Objective() 2010: Intro to JEE Servlet Containers for ColdFusion Developers

Note: this has also been translated to Spanish, here.

I am thrilled and honored to have the opportunity to speak at this year's cf.Objective() 2010 conference! My session title is "Intro to JEE Servlet Containers for ColdFusion Developers" and here is the preliminary description I used when submitting my session topic:

An alternate title for this session might be, "What the heck is a servlet container and what does it have to do with CFML?" We'll discuss the relationship between CFML "engines" (i.e., servlets), JEE application servers and servlet containers, and Web servers. Understanding the basics of this relationship can provide CFML developers with a greater confidence to leverage underlying Java tools, improve development environments and deployments and write more flexible and powerful applications.

Why Bother?

I submitted this topic because I believe there are many CF developers, of all skill levels, with very little knowledge in this area. I was most certainly one of these developers for the better part of my CF career thus far! Over the past year or two I've developed a much deeper understanding of Java Enterprise Edition (JEE/J2EE), Servlets, Servlet Containers, Java Application Servers and Web servers. Most importantly I've learned a lot more about how Adobe ColdFusion, Open BlueDragon and Railo leverage the power of these Java platform specifications.

Much of my learning has been out of necessity -- and I feel like I had to do it the hard way (on my own)! But looking back, had I possessed some base knowledge in the right areas, I really think I may have put all the puzzle pieces together much more quickly. So I'm hoping to provide these building blocks in my cf.Objective() session this year.

You don't need to become a Java guru to grok these concepts, but they can greatly increase your toolset as a ColdFusion developer, allowing you to design and develop more robust applications and gain greater marketability in the job market. Here are some points that I hope to provide attendees:

  • 10,000-foot view of how CFML Engines, Servlet Containers, Java Applications Servers and Web Servers interact to make the magic we've all come to know and love
  • Understanding the many options the Adobe ColdFusion installer provides and what you can (and might want to) do on your own
  • Confidence and flexibility in CF development environments (application isolation, starting app servers from your IDE, super-simple portability, etc.)
  • Configuration options to keep both development and production environments running smoothly
  • Understanding and leveraging EAR/WAR deployments
  • Awareness of the many options and not being afraid to check them out!

Lots to talk about, feedback needed!

As you can imagine, there is a lot that can be covered here. My goal for this session is to provide an understanding of the important pieces of the big picture, tools you can put to immediate use, and a confidence to safely explore more deeply. If any of the concepts or buzz words I've mentioned in this post are scary, please know that they're not -- not if you start in the right place.

If you feel any one area or concept that I've mentioned would be of greatest value to you... If you have a more specific question that keeps coming up, or something that you continue to avoid... If you know this stuff cold, but see common problem points out in the CFML community... I would highly value your feedback as I continue to refine my session preparation. Please comment on this blog post or use my contact form to contact me directly.

Whether you're already grokking some or none of what I've discussed here, I hope you can make it to my cf.Objective() session and take away some useful bits!

CFC Creation Time in ColdFusion 8/9, Open BlueDragon 1.1 and Railo 3.1

There's lots of chatter about CFC creation performance in the popular CFML engines (Adobe ColdFusion, Open BlueDragon and Railo), and plenty of others have ran their own tests, but I'm just curious and had to see some tests for myself.

I do not intend to encourage anyone to choose any one engine over another solely based on these tests. This is just one small indicator of the many performance considerations! In a real world application, there are many other performance considerations (hardware, operating system, application server, JVM tuning, CFML engine admin settings, various cache mechanisms, database server, database tuning, etc.).

I'm just focused on the speed of CFC creation here. In many small or medium sized apps, this is not much of a factor, but in larger applications where large sets of objects need to be created, this can potentially become crippling to application performance.

Also keep in mind that not all CFML applications are guaranteed or even likely to migrate flawlessly between any two CFML engines, despite lots of great progress towards compatibility and a core CFML spec. There are also lots of vendor specific features that may sway a particular developer or team to a particular CFML engine, and this may vary from project to project.

I could ramble on with more disclaimers, but let's get to the good stuff!


"Does anyone have an opinion on Adobe Coldfusion?"

A (very) brief list of ColdFusion/CFML resource links in response to Tweet from @ryanmaurodesign: "Does anyone have an opinion on Adobe Coldfusion?"

The short answer: yes :) There is a vibrant CFML community and many will be excited to tell you why it's so fantastic!

Adobe ColdFusion Evangelism Kit

Other major (open source and free) CFML engines:
Open BlueDragon

CFML Advisory Committee

ColdFusion is a Java EE application...

Just a few of the very many busy bloggers:
Ben Forta
Ben Nadel
Charlie Arehart
Hal Helms
Ray Camden
Sean Corfield

...and a bunch more ;-)

A bunch of open source ColdFusion apps (as well as other Adobe RIA related stuff):

Popular MVC frameworks (there are more):

Other popular frameworks (there are more):
ColdSpring ("Spring framework for ColdFusion")
Reactor (ORM)
Transfer ORM

There's a ton of other great information out there, so go check it out! (Ignore the occasional/ignorant "ColdFusion is dead" nonsense that somehow still creeps up from time to time, despite continued growth!:)

cfmail using Gmail SMTP

I wanted to have a cfmail tag use my Gmail SMTP to send mail, which was relatively straightforward, but there is some vague language in the Google help doc that didn't immediately translate to cfmail attribute settings. I did find plenty of search results on the topic, but most threads were a little confusing and noted differing experiences between developers. So I've taken a little time to experiment and thought I'd share the results.

From both my account and my Google Apps for Your Domain mail (gmail for custom domain name) accounts I was able to find the same help doc for standard POP/SMTP configuration.

We can quickly deduce that the username attribute should be your full e-mail address (including or, and the password is of course your Gmail password.

The help doc provides the following information for the outgoing/SMTP server configuration: (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587

So, how does the above information translate to relevant cfmail tag attributes (server, port, username, password, useSSL, useTLS)? It's a bit more specific than the Gmail help doc suggests...


ColdFusion round() function bug when operation performed on argument

UPDATE (July 15, 2009): This "bug" still exists in Adobe ColdFusion 9 beta 1. It also seems to behave the same in OpenBD 1.1. This bug does not seem to exist in Railo (I can't reproduce any similar problems in Railo 3.0 or Railo 3.1). For example, round(4.0005*1000) outputs 4000 from both AdobeCF and OpenBD while Railo outputs the expected 4001. There may very well be other scenarios where a floating point representation causes similar unexpected results in Railo as well, but I have not been able to find it yet (nor have I performed an absolutely thorough test, maybe soon if time permits).

Have you ever used a CFML trick like this to round a number to the nearest hundredth?


I have, and I never had a problem, until...

    valueA = 4000.5;
    valueB = 4.0005*1000;
    roundedA = round(valueA);
    roundedB = round(valueB);

You'd be perfectly sane to expect the first two variables to output as 4000.5 and the second two (rounded) to output 4001. Unfortunately, roundedB is output as 4000, not 4001!

This definitely appears to be a bug, but I do have a rather simple workaround...


Hello, [blog] world!

Yes, it was probably at least two years ago when I first thought, "I should start blogging," and here, finally, is my first ever post. Since this will be a blog about ColdFusion development and other programming related topics, I couldn't resist a "hello world" style title for my first post. That said, I'd like to share a little about why I decided to start blogging, what I hope to share and what I hope to gain from blogging.

First, my relevant geek background, in a nutshell:

  • First program written in BASIC on a TRS-80 to calculate my baseball batting average at approximately 10 years old.
  • Geeked out in MS-DOS, C programming and a touch of Perl (1989-1994).
  • Finally made the switch from DOS to Windows 95 in 1996.
  • Entered the University of Rochester as a computer science major -- a little too disinterested in many of the non-programming topics -- graduated with a music degree and a minor in mathematics, but also got a good little dose of data structures, Java and C++.
  • HTML, MS Access and other general computer-related gigs for a couple years (1998-1999).
  • Web development using ASP scripting with MS Access and SQL Server databases (1999-2002).
  • Fell in love with ColdFusion around 2001 (using ColdFusion 4.52 at first) and used it to build and maintain dozens of sites (2001-2003).
  • Really started digging in to object oriented CFML development and helped build, grow and maintain a group of large-scale applications primarily running Mach-II and ColdSpring (with a touch of Transfer, Reactor and Model-Glue) (2004-2008).
  • Read on for present-day geekiness...

In October of 2008 I decided to go solo and freelance develop again to have a better opportunity to code and learn and code and learn (as opposed to management and meetings and management and meetings). I've spent the last few months doing nothing but coding and learning, and I'm loving it! My main project right now is, which I've built up from a blank slate, using ColdFusion 8 Enterprise on Linux, PostgreSQL 8.3, Model-Glue 3 (Gesture, bleeding edge release), ColdSpring, Transfer ORM, MXUnit, jQuery and and I even wrote a little code myself :) I also decided to ditch Microsoft entirely and I'm running Ubuntu 8.04 on my development laptop, along with a Windows XP VM via VirtualBox virtualization to allow for IE testing (will be looking to setup a Mac testing ground as well). This project has helped me ask and answer a lot of questions around good object oriented design, best practices, using the right tools, etc. Though I feel I've had a great sprint of learning over the past few months, I'm hungry to absorb so much more!

That brings me back to my main point, this blog. From many other bloggers I've learned a lot through finding countless answers, great tips, great examples and tutorials, etc. I've also solved a number of problems either on my own or with the help of tid-bits from various online resources. So, I'd like to have a platform to share when I think I have something worth sharing, and that will be this blog. I will also likely blog about some of my own learning experiences, when I think it might help others embarking on a similar learning path. If I'm lucky, some folks might actually read my blog and share some feedback, which will help me and other readers learn more and better ourselves as programmers.

Well, thanks for reading. Cheers to blogging!

BlogCFC was created by Raymond Camden.