
14
DEVELOPING
COLDFUSION 9 APPLICATIONS
Introducing ColdFusion
Las
t
upda
te
d 8/5/2010
ColdFusion pages are plain text files that you use to create web applications. You can create your ColdFusion
applications by writing all the code manually or by using wizards (provided with some editors) to generate the majority
of the code for you.
Saving ColdFusion pages
In order for the ColdFusion server to process a page, save the ColdFusion page on a computer where ColdFusion is
installed. If you are creating your pages on a local server (on which ColdFusion is running), you can save the pages
locally; if you are using a remote server, save your pages on that server.
If you are using the J2EE configuration, you typically save ColdFusion pages under the ColdFusion
web application
root
. For example, in the default directory structure when you use the J2EE configuration with JRun, you save pages
under
jrun_root
/servers/cfusion/cfusion-ear/cfusion-war.
Testing ColdFusion pages
To ensure that the code you wrote is working as expected, you view the ColdFusion page in a browser by going to the
appropriate URL, for example
http://localhost/test/mypage.cfm
. If you are using the built-in web server,
specify the port to use in the URL, for example,
http://localhost:8500/test/cfpage.cfm
. The address localhost
is only valid when you view pages locally.
Note:
On Vista, the address
::1
is equivalent to localhost. You can use the ColdFusion
GetLocalHostIP
function to get
the IP address of localhost.
The URL for a remote site includes the server name or IP address of the server where ColdFusion is installed; for
example,
http://<serveripaddress>/test/mypage.cfm
. Some ColdFusion J2EE configurations require a context
root in the URL; for example,
http://<server>/<context-root>/mypage.cfm
. For example, if you deploy an EAR
file and use the default context root of cfconroot, you specify
http://localhost/cfconroot/test/mypage.cfm
.
Elements of ColdFusion
ColdFusion consists of the following core elements:
•
ColdFusion scripting environment
•
CFML
•
ColdFusion Administrator
•
Verity Search Server
The ColdFusion scripting environment
The ColdFusion scripting environment provides an efficient development model for Internet applications. At the
heart of the ColdFusion scripting environment is the ColdFusion Markup Language (CFML), a tag-based
programming language that encapsulates many of the low-level details of web programming in high-level tags and
functions.
ColdFusion Markup Language
ColdFusion Markup Language (CFML) is a tag-based language, like HTML, that uses special tags and functions. With
CFML, you can enhance standard HTML files with database commands, conditional operators, high-level formatting
functions, and other elements to rapidly produce web applications that are easy to maintain. However, CFML is not
limited to enhancing HTML. For example, you can create Flash output that consist entirely of Flash elements and
CFML. Similarly, you can use CFML to create web services for use by other applications.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...