Introduction to ColdFusion

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter E.  ColdFusion MX Tags and Beyond


ColdFusion is an application server. In common with all application servers, it processes the server-side code instructions before returning the page to the client. Although traditional, static Web servers can respond only to requests for pages and return a static copy of the page to the client, with an application server you can

  • Interact with a user through the use of forms to provide searching and other facilities on the site.

  • Dynamically construct pages based on database results or other applications.

  • Save customized information such as user preferences.

As explained in Chapter 21, "Working with CGI & Java Applets," the Web server and application server, such as ColdFusion, work together to process a page request from a user. This is what happens when the user requests a page from a Web site that uses ColdFusion.

  1. The user requests a page by typing a URL into the browser or clicking a hyperlink.

  2. The Web server receives the request. If the page requested is a static Web page indicated by the extension HTM or HTML the Web server simply sends a copy of this page to the client. This static page may still contain elements such as Flash movies or JavaScript that are processed on the client, but these elements are not the responsibility of the Web server.

  3. If the page requested has the extension CFM, CFML, or CFC (for ColdFusion) the Web server passes the request on to the ColdFusion application server.

  4. The application server runs the ColdFusion code to produce dynamically generated HTML. If the page contains HTML code (which most ColdFusion pages do) this is left untouched by ColdFusion.

  5. After the code has been processed, the page is handed back to the Web server.

  6. The Web server returns the page to the user.

This process is illustrated in Figure E.1.

Figure E.1. Application servers such as ColdFusion work with the Web server to process dynamic pages.

graphics/efig01.gif

This process is common to all application servers. With ColdFusion, the Web developer has a scripting environment that is much easier to code than other application servers, such as ASP.NET, ASP, JSP, or PHP all of which are also supported by Dreamweaver.

ColdFusion uses a language called ColdFusion Markup Language (CFML) to code the server-side processing instructions. CFML is considerably easier to code than Visual Basic or JavaScript like languages that other application servers use.

ColdFusion Markup Language (CFML) is a tag-based language, like HTML. CFML tags have start tags; usually they also have bodies and end tags and look very much like HTML. They provide a familiar way to code pages for Web designers.

CFML is made up of about 80 tags that provide a rich language for programming dynamic data-driven pages. CFML also encapsulates a lot of low-level programming detail within the CFML tags, so you do not have to instantiate low-level application objects or navigate through complex object interfaces, which most other application servers require you to do. With ColdFusion it is easy to

  • Send emails from your Web application.

  • Perform full-text searches through files in your Web site.

  • Upload files to the server.

  • Dynamically create charts in Web pages.

These tasks, quite complex in most application servers, can be done with just a few or even one CFML tag.

ColdFusion also contains the capability for you to write your own functions and create your own customized tags. ColdFusion has a scripting language similar to JavaScript, called CFScript, that can do this. If you really wanted to, you could use C++ or Java to customize your tags as well.


    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net