ColdFusion Example (MCS-270, Spring 2001)

Another way to construct a web-based application is using ColdFusion. This tends to be physically three-tier (with the presentation layer, application layer, and database layer running on three different computers), but the HTML code for the presentation layer tends to be mixed together in the same files with the ColdFusion code for the application layer. None the less, it can be a very quick way to get a simple web-based, database-backed application up and running.

I've written an example application that finds movies from our database containing a desired actor, but without the constraint of having copies in stock at a particular store. Here are two verisons (these worked at the time of the course, but probably no longer):

Both versions will take you directly to information about the movie, if we only know of one movie with that actor, or will take you to a list of movies, if there are several. (If there are none, you will be told.) The information about movies includes information from our database, a link to external information (at, and a primitive rating service that shows how previous users have rated the movie and gives you a chance to add your own rating.

To see the code for this example, look in the directory

In this directory, the two initial user interfaces are input-actor.cfm and choose-actor.cfm. Once you select an actor, you go to movies-by-actor.cfm, and from there to movie-details.cfm. If you submit a rating, that is processed by rate-movie.cfm.

For more information about ColdFusion, you can look at the book we have in the lab monitor room.