Browsing your code

To ensure that the code you wrote is working as expected, you must view the ColdFusion page in a browser. The following procedure describes how to view the ColdFusion page that you created earlier.

To view the ColdFusion page:

  1. Open a web browser and go to the following URL:

    http://localhost/test/cfpage.cfm

    Note: If you are using the built-in web server, specify the port to use in the URL as follows:
    http://localhost:8500/test/cfpage.cfm.

    The address localhost is only valid when you view pages locally. The URL for a remote site would include the server name or IP address of the server where ColdFusion is installed; for example, http://<serveripaddress>/test/cfpage.cfm.

    If you are using the ColdFusion MX J2EE configuration, you may also need to include a context root in the URL; for example, http://<server>/<context-root>/<page>.cfm. For example, if you deploy an EAR file and use the default context root of cfmx, you specify http://localhost/cfmx/test/cfpage.cfm.

    The following figure shows the cfpage.cfm page in the browser:


    This image shows the results of step one in a browser window:Hello world, this is a ColdFusion page.Today’s date is 17-Feb-02

  2. Do the following tasks:
    1. View the source code that was returned to the browser. In most browsers, you can view the source by right-clicking on the page, and then selecting View Source.
    2. Compare the browser source code with the source code that appears in your editor. Notice that the CFML tags were processed on the page but did not appear in the source that was returned to your browser.

      As described in Introducing ColdFusion MX, ColdFusion processes all the instructions (CFML tags and functions) it receives on a page, and then returns the results of the instructions that your browser can interpret and display.