BANGALORE, INDIA: We all know how important Internet based applications have become and how enterprises are taking to them in a big way. One way of creating these applications is using ColdFusion language, and with the latest version, developers can use the ColdFusion Builder IDE that is filled with all resources for quick development of these applications. In this article we use this IDE to create a simple application.
Implementing ColdFusion9
You can download ColdFusion9 and ColdFusion Builder from http://tinyurl.com/5njlm3. The installation of ColdFusion builder is straight forward and there are just two modes of installation. If you are already using Eclipse IDE, the software can add a plug-in to it, or one can have a stand alone application of ColdFusion Builder. For this article we have used ColdFusion Builder as a stand alone application.
Now that we have all the tools for writing a ColdFusion application, let's start by building a sample application. First open ColdFusion Builder, alternately, if you are using Eclipse select ColdFusion perspective. The next step is to define connection to a ColdFusion Server. For this, click on the 'Server' tab at the bottom. Then click on Add Server button that is shown by a server and '+' sign. This action would pop up 'Add Server' window. Here one needs to select 'ColdFusion' as server type.
The next window would prompt a user to enter server settings. Here, enter a unique 'Server Name' so that you can remember it from the server list. The next important configuration to be entered is 'Host Name' which is the IP address of the server ('localhost' in our case). In 'Other Settings' enter 8500 as 'WebServer Port' and the RDS user name and password defined during installation.
In Local Server Settings enter 'Server Home' and 'Document Root' and click on Finish. Now as we are using local machines the settings in our case would be 'C:\ColdFusion9' and 'C:\ColdFusion9\workout' respectively. You would be able to see the defined server in the server list at bottom. One can right click on this server to change settings and state.
This is the interface of ColdFusion Builder. At the bottom we can see a list of servers while on the left we can see created projects. |
Click on File>New>ColdFusion Project and give a name to your project ('ColdfusionSample'). We need to store this project at the web root of ColdFusion Server. Create a new folder in root and add this path in 'Project Location' field and click on Next. In this window, one needs to define the server, select created server ('localhost') from drop down list box and click Finish. In this implementation, we would create two pages, the first one would be used to enter user names while the second would display the name along with a message. To accomplish this, create two ColdFusion pages by right clicking project in left window and clicking on 'New>ColdFusion Page'. Name these pages as 'TestOne.cfm' and 'TestTwo.cfm'. Now add the following code to TestOne.cfm:
This is the interface of ColdFusion Builder. At the bottom we can see a list of servers while on the left we can see created projects. |
The Server configuration settings window pops up when you click on the server sign at the bottom of Builder window. |
These windows show the created page. Enter your name in the left window and hit 'Submit'. This would display the newly created welcome message, shown in the right window. |
This is a simple code that creates a text box and button. The most important tag in this code is
Welcome to my website!,
This is first ColdFusion application
created by
using ColdFusion Builder
In the above code