Accessibility

Table of Contents

Customizing the Eclipse IDE for robust ColdFusion application development

Configuring CFEclipse to work with ColdFusion

Assuming you already have ColdFusion 8 or earlier installed, be sure ColdFusion is running and you have a site folder in your ColdFusion wwwroot/ folder. This article assumes that you are running ColdFusion locally with the built-in JRun Server. However, if you are not, simply change the path in this tutorial to wherever your ColdFusion applications typically reside within your web root.

  1. In CFEclipse, click File > New > Project to open the New Project wizard.
  2. Click the plus symbol next to the CFEclipse Folder to expand the contents.
  3. Select CFML Project (see Figure 2) and click Next.

    The New Project wizard

    Figure 2. The New Project wizard

  4. Give your project a name (see Figure 3).

    Naming a project

    Figure 3. Naming a project.

  5. Deselect the "Use default location" option and browse to a location. Browse to the wwwroot/ folder of your ColdFusion 8 server (usually on your C:/ drive) and select your site folder. If you don't already have a folder in the wwwroot/ folder, you can create one now.
  6. Click Next to return to the CFEclipse perspective.
  7. Right-click your project and select Select Edit URL from the pop-up menu.
  8. Enter the local path of your ColdFusion server (see Figure 4). This is should be your localhost at port 8500, assuming you installed a ColdFusion developer server and used the built-in JRun server: http://localhost:8500/MyProject
  9. Click OK.

    Entering the local path to your ColdFusion server

    Figure 4. Entering the local path to your ColdFusion server

Testing your configuration

To test your configuration, create a CFML page with some sample code to test your set up.

  1. Create the page. Right-click your project and select New > CFML Page (see Figure 5).

    Selecting CFML page option

    Figure 5. Selecting CFML page option.

  2. Give your page a name; I named mine test.cfm. In the test.cfm page, type <cfoutput>##</cfoutput>.

    Notice how adding one hash(#) creates two. CFEclipse has code completion capabilities. Although this is a very simple example, you may find CFEclipse finishing your syntax for you. It has great coding tools and reference guides as well.

  3. Select the Dictionary view by clicking Window > Show View > Dictionary View (see Figure 6).

    Selecting the Dictionary View

    Figure 6. Selecting the Dictionary View

  4. In the Dictionary view, Select cf8 from the pop-up list and expand the Functions folder. Scroll down the list to select the Now() function.
  5. Click between the two hash marks in your code and double-click the Now() function in the Dictionary view. You will see that the code was added to the page. The hash marks (#) appear around the Now() function so that your code looks like the following:

    <cfoutput>#now()#</cfoutput>
  6. Save your test.cfm page (Control + S).
  7. Select your Browser view tab below your test.cfm page. If it is not already visible, you can click the Show view button to select the Browser View (see Figure 7).

    Opening up the Browser View

    Figure 7. Opening up the Browser View

  8. In your Browser View tab, add the test.cfm URL to your site path. Click the Refresh button and a timestamp displays.

If you received an error, check to make sure you do not have any typos in your code, that the URL is correct, that you saved your page, and that ColdFusion is running.