Home arrow ColdFusion arrow Page 6 - My First Application on ColdFusion MX Server
COLDFUSION

My First Application on ColdFusion MX Server


Like HTML, ColdFusion is a tag based language. If you have ever wanted to gain a working knowledge of ColdFusion, you will find this article to be a good place to start. It covers starting and stopping the MX 7 server, configuring a virtual directory, and testing the directory.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 46
August 08, 2005
TABLE OF CONTENTS:
  1. · My First Application on ColdFusion MX Server
  2. · Accessing Server Administration Panel from IIS
  3. · Creating a Virtual Directory to Publish CFM Files
  4. · Virtual Directory Properties
  5. · Creating a Web Page with the CFM Extension, our First ColdFusion Page
  6. · ColdFusion Tags CFSET and CFOUTPUT

print this article
SEARCH DEVARTICLES

My First Application on ColdFusion MX Server - ColdFusion Tags CFSET and CFOUTPUT
(Page 6 of 6 )

These two tags are used to manipulate variables, and in the next tutorial we shall look at a number of other useful tags in writing content, in creating data based applications, and so on.

The CFSET tag is used to assign a variable, in the above case, a string variable strg with a value Welcome to ColdFusion MX 6.1. We will have occasion to look at these more closely  later on. For now it is sufficient to know that the variable strg has been assigned a value.

The CFOUTPUT tag allows displaying of the variable in the browser when the HTML page is rendered. The variable strg must be enclosed between #...# for strg to be interpreted as a variable, otherwise, it will be interpreted as a literal string and returned as such. It is important to get used to the syntax. The tags almost always come in pairs, an opening tag with or without the attributes and a closing tag. The tags are not case sensitive as in XML (see last picture), although there are rules as to what characters can be used for variables and other things. We shall look at these in the next and later tutorials.

Browsing the CFM file

If the URL http://localhost/TestingCF is typed in the address field of a browser, we should see the output of the CFM as well as the HTML rendered, as seen in the next picture.

TestCf.jpg display

One should not be left with the impression that CFM should always be embedded in an HTML file. The next file, Test.cfm, is also correct, as shown below:

<cfsEt strg="<b>Welcome to ColdFusion MX 6.1</b>">
<cfoutput>
#strg#
</cFouTput>
Testcfm.jpg display

You might have noticed that the "Welcome to ColdFusion MX6.1" is in bold. This is to say that after processing the "CF" tags the result is returned in HTML. Also notice that the tags are not case sensitive, <cfoutput> is same as <CfoUtPut>.

Summary

The ground work for creating CFM files and publishing them to an IIS server has been accomplished. Files are copied to, or uploaded to the MyCFusion directory, and they are accessed by the URL of the virtual directory, http://localhost/TestingCF. The files may also be browsed by directly going to the IIS. Two of the important tags were discussed as well, namely CFSET and CFOUTPUT. It must be remembered that, if the server is not running, accessing the file on the server would produce a Server not Found, or DNS error. Either you may set the server to start automatically, or remember to start the server before it can serve the pages.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
COLDFUSION ARTICLES

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials