This section defines frequently used terms
relating to web applications.
An application server is
software that helps a web server process web pages containing server-side
scripts or tags. When such a page is requested from the server, the web server
hands the page off to the application server for processing before sending the
page to the browser.
Common application servers include Macromedia
ColdFusion, Macromedia JRun Server, the Microsoft .NET Framework, IBM
WebSphere, and Apache Tomcat.
A database is a
collection of data stored in tables. Each row of a table constitutes one record
and each column constitutes a field in the record, as shown in the following
example.
A database driver is
software that acts as an interpreter between a web application and a database.
Data in a database is stored in a proprietary format. A database driver lets
the web application read and manipulate data that would otherwise be
undecipherable.
A database management
system (DBMS, or database system) is software used to create and
manipulate databases. Common database systems include Microsoft Access, Oracle
9i, and MySQL.
A database query is the
operation that extracts a recordset from a database. A query consists of search
criteria expressed in a database language called SQL. For example, the query
can specify that only certain columns or only certain records be included in
the recordset.
A dynamic page is a web
page customized by an application server before the page is sent to a browser.
A
recordset is a set of data extracted from one or more tables in a database,
as in the following example:
A relational database is a
database containing more than one table, with the tables sharing data. The
following database is relational because two tables share the DepartmentID
column.
A server technology is the
technology that an application server uses to modify dynamic pages at runtime.
The Dreamweaver development environment supports
the following server technologies:
·
Macromedia ColdFusion
·
Microsoft ASP.NET
·
Microsoft Active Server Pages (ASP)
·
Sun Java Server Pages (JSP)
·
PHP: Hypertext Preprocessor (PHP)
You can also use the
Dreamweaver coding environment to develop pages for any other server technology
not listed.
A static page is a web
page that is not modified by an application server before the page is
sent to a browser.
A web application is a
website that contains pages with partly or entirely undetermined content. The
final content of these pages is determined only when a visitor requests a page
from the web server. Because the final content of the page varies from request
to request based on the visitor's actions, this kind of page is called a
dynamic page.
A web server is
software that sends out web pages in response to requests from web browsers. A
page request is generated when a visitor clicks a link on a web page in the
browser, selects a bookmark in the browser, or enters a URL in the browser's
address text box.
Popular web servers include
Microsoft Internet Information Server, Microsoft Personal Web Server, Apache
HTTP Server, Netscape Enterprise Server, and Sun ONE Web Server.
How
a web application works
A web application is a collection of static and
dynamic web pages. A static web page is one that does not change when a
site visitor requests it: The web server sends the page to the requesting web
browser without modifying it. In contrast, a dynamic web page is
modified by the server before it is sent to the requesting browser. The changing
nature of the page is why it's called dynamic.
For example, you could design a page to display
fitness results, while leaving certain information (such as employee name and
results) to be determined when the page is requested by a particular employee.
This section contains the following topics:
·
Processing static web pages
·
Processing dynamic pages
·
Accessing a database
Processing
static web pages
A static website comprises a set of related HTML
pages and files hosted on a computer running a web server.
A web server is software that serves web pages
in response to requests from web browsers. A page request is generated when a
visitor clicks a link on a web page, selects a bookmark in a browser, or enters
a URL in a browser's address text box.
The final content of a static web page is
determined by the page designer and doesn't change when the page is requested.
Here's an example:
<html>
<head>
<title>The Next Globe Blog</title>
</head>
<body>
<h1>The Next Globe</h1>
<p>A blog for latest and updates </p>
</body>
</html>
Every line of the page's HTML code is written by
the designer before the page is placed on the server. Because the HTML doesn't
change once it's on the server, this kind of page is called a static page.
When the web server
receives a request for a static page, the server reads the request, finds the
page, and sends it to the requesting browser, as shown in the following figure:
In the case of web applications, certain lines
of code are undetermined when the visitor requests the page. These lines must
be determined by some mechanism before the page can be sent to the browser. The
mechanism is discussed in the following section.
Processing
dynamic pages
When a web server receives a request for a
static web page, the server sends the page directly to the requesting browser.
When the web server receives a request for a dynamic page, however, it reacts
differently: It passes the page to a special piece of software responsible for
finishing the page. This special software is called an application server.
The application server reads the code on the
page, finishes the page according to the instructions in the code, and then
removes the code from the page. The result is a static page that the
application server passes back to the web server, which then sends the page to
the requesting browser. All the browser gets when the page arrives is pure
HTML. Here's a view of the process:
Accessing
a database
An application server lets you work with
server-side resources such as databases. For example, a dynamic page may
instruct the application server to extract data from a database and insert it
into the page's HTML.
The instruction to extract data from a database
is called a database query. A query consists of search criteria expressed in a
database language called SQL (Structured Query Language). The SQL query is
written into the page's server-side scripts or tags.
An application server cannot communicate
directly with a database because the database's proprietary format renders the
data undecipherable in much the same way that a Microsoft Word document opened
in Notepad or BBEdit may be undecipherable. The application server can
communicate with the database only through the intermediary of a database
driver: software that acts like an interpreter between the application server
and the database.
After the driver establishes communication, the
query is executed against the database and a recordset is created. A recordset
is a set of data extracted from one or more tables in a database. The recordset
is returned to the application server, which uses the data to complete the
page.
Here's a simple database query written in SQL:
SELECT
lastname, firstname, fitpoints
FROM
employees
This statement creates a three-column recordset
and fills it with rows containing the last name, first name, and fitness points
of all employees in the database.
Here's an illustration of the process of
querying a database and returning data to the browser:
You can use almost any
database with your web application, as long as the appropriate database driver
for it is installed on the server.
If you plan to build small low-cost
applications, you can use a file-based database, such as one created in
Microsoft Access. If you plan to build robust, business-critical applications,
you can use a server-based database, such as one created in Microsoft SQL
Server, Oracle 9i, or MySQL.
If your database is located on a system other
than your web server, make sure you have a fast connection between the two
systems so that your web application can operate quickly and efficiently
Authoring
dynamic pages
Authoring a dynamic page consists of writing the
HTML first, and then adding the server-side scripts or tags to the HTML to make
the page dynamic. When you view the resulting code, the language appears
embedded in the page's HTML. Accordingly, these languages are known as HTML
embedded programming languages. The following basic example uses ColdFusion
Markup Language (CFML):
<html>
<head>
<title>The Next Globe Blog</title>
</head>
<body>
<h1>The Next Globe Blog</h1>
<p>The Next Globe Blog</p>
Server
technology |
Language |
ColdFusion |
ColdFusion Markup Language (CFML) |
ASP.NET |
Visual Basic C# |
Active Server Pages (ASP) |
VBScript JavaScript |
Java Server Pages (JSP) |
Java |
PHP |
PHP |
Comments
Post a Comment