Join David Gassner for an in-depth discussion in this video Understanding application servers, part of ColdFusion 9 Essential Training.
If this is your first experience building dynamic web applications with ColdFusion or any other application server, it's useful to understand the basic nature of the web and how it works. What we call the World Wide Web is really a whole bunch of computers that are connected to each other over the Internet that communicate with each other over a protocol called HTTP. HTTP stands for Hyper Text Transfer Protocol, and it's a simple text-based language that lets computers or browsers make requests and allow servers to send back responses.
Each of the clients has a browser of some sort. The browsers we're almost familiar with are those on personal computers such as Internet Explorer, Firefox, Safari, or Google Chrome, a newer entry. But cell phones such as the iPhone, or BlackBerrys, or other modern cell phones typically have browsers as well. There are many other devices that can participate in the web. The server runs some software called an HTTP Server. The most commonly used HTTP servers are those listed here: Internet Information Services or IIS, which is a Microsoft product that's included with Windows-based operating systems, or Apache, which is available on pretty much all operating systems, and is built and delivered as a free open-source product by the Apache Foundation, a nonprofit organization.
Simple HTTP client-server communications work like this. The web client sends a request for a page, an image, or some other content. The server receives and interprets that request and sends the response back to the client. It's up to the client to read that response, whether it's HTML or some other content, and render it, or interpret it, in some fashion. When you add an application server into the mix, the application server is connected to the web server or HTTP server. The HTTP request still goes from the web client to the HTTP server, but then the HTTP server is configured to dispatch that request to a particular application server, typically by recognizing a file extension on the request, .cfm for ColdFusion, .aspx for ASP. NET, .php for PHP, or others.
The application server then has access to server-side resources such as a database. It does its work, talks to the database if necessary, and generates a response which it returns to the HTTP server. Then the HTTP server, once again, sends back the response to the client. The web client doesn't know anything about the application server. All it knows is that it requested HTML and it got back HTML. The application server is completely confined to the server environment. There are many available application servers on the market.
In this video series, I'll be teaching you how to use Adobe's ColdFusion 9. Other developers and organizations might use Microsoft's Classic Application Server, Active Server Pages, or its more modern version, ASP.NET. There is also PHP, a free open-source server, and Java-based servers, sometimes known as J2EE, or Java Enterprise Edition servers. These services include IBM WebSphere, WebLogic, and JBoss. Adobe ColdFusion is a special product because it lets you build these web applications very quickly.
In ColdFusion 9, many of the commands that we traditionally execute in tag-based language can now also be processed with scripting syntax. At the bottom of the screen, I've shown the scripting equivalent of the CFOutput tags, a function called writeOutput. Your CFScript code is wrapped inside a pair of CFScript tags, and then you follow scripting syntax as much as you can. Many developers feel that the scripting syntax is easier to both write and read than the traditional tag-based syntax. Not all ColdFusion tags have been rewritten as scripting commands, but in ColdFusion 9, many more are available in scripting than ever before.
ColdFusion 9 includes many new features that you'll find valuable. One of the most valuable, and one that I cover extensively in this video series, is Object Relational Mapping or ORM, an extraordinarily simple way of communicating with the database. There are also many new tools for integration with Microsoft Office and SharePoint, including the ability to read and write Microsoft Word, Excel, and PowerPoint files. There are new integration tools for Adobe Flex & AIR developers, enhancements to the language, performance enhancements and many other new features to make ColdFusion 9 easier and more powerful than before.
If you're new to ColdFusion, you'll find that this video series will get you up and started very quickly building ColdFusion applications. If you're an experienced ColdFusion developer, you'll find some information on the new features here and a lot more in another lynda.com video series, ColdFusion 9 New Features.
- Using ColdFusion Builder to define a default page template
- Defining a data source with ColdFusion Administrator
- Creating data access ColdFusion Components (CFCs) in ColdFusion Builder
- Using ColdFusion ORM (Object Relational Mapping)
- Applying dynamically developed URLs to datasets
- Validating data entry forms and defining client-side validation rules
Skill Level Beginner
Q: While trying to build a dynamic site as instructed in the <em>ColdFusion 9 Essential Training</em> title, an error occurred when setting up the Date & Services > Data Sources page as shown in the "Defining a data source in ColdFusion Administrator" movie: <div><br /> </div> <div><strong>Connection verification failed for data source: dw_bookstore. com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. </strong></div> <div><br /> </div> <div>Also, attempts to connect to the database using phpMyAdmin were not successful. Is there a fix to this problem?<br /> </div>
A: If the connection to phpMyAdmin is not working, starting over with the installation of MySQL is the best bet. Uninstall WampServer, then reinstall and set up the database again. If that software is not working, the connection to the database from will not be possible from ColdFusion.<br />