MACROMEDIA COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX Getting Started page 17

Building coldfusion mx applications
Table of Contents

Advertisement

To create a ColdFusion page:
Open your editor and create a blank file.
1
Enter the following code on the page:
2
<html>
<head>
<title>A ColdFusion Page</title>
</head>
<body>
<strong>Hello world, this is a ColdFusion page.</strong>
<br>
<cfoutput> Today's date is #DateFormat(Now())# </cfoutput>
</body>
</html>
Saving your ColdFusion page
In order for the ColdFusion server to process the page, you must save the ColdFusion page on a
computer where the ColdFusion MX is installed. If you are creating your pages on a local server
(on which ColdFusion is running), then you can save the pages locally; if you are using a remote
server, then you must save your pages on that server.
If you are using the ColdFusion MX J2EE configuration, you typically save ColdFusion pages
under the ColdFusion web application root. For example, in the default directory structure when
using the J2EE configuration with JRun, you save pages under jrun_root/servers/cfusion/cfusion-
ear/cfusion-war. When using JRun, you can also run the Web Server Configuration Tool and
save pages under your web root directory.
Tip: ColdFusion MX on Macintosh OS X uses the J2EE configuration.
To save the code you typed to create a ColdFusion page:
Create a new directory called test under the web_root or web_application_root directory.
1
In the test directory, save the file as cfpage.cfm.
2
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:
Open a web browser and go to the following URL:
1
http://127.0.0.1/test/cfpage.cfm
The address 127.0.0.1 refers to the localhost and 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, 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://127.0.0.1/cfmx/test/cfpage.cfm.
Working with ColdFusion pages
17

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?

This manual is also suitable for:

Coldfusion mx

Table of Contents