Quick Start Guide
How a web application works 221
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:
Application server
Request
Web browser
<HTML>
<code>
</HTML>
Response
<HTML>
<p>Hi
</HTML>
WEB SERVER
Step 1 - Web
browser requests
dynamic page.
Step 2 -
Web server
finds page
and passes it
to application
server
Step 3-
Application server
scans page for
instructions and
finishes page.
Step 4-
Application server
passes finished
page back to web
server
Step 5 - Web
server sends
finished page to
requesting browser