JavaServer Pages
its own connection. An application server can maintain a central "pool" of open
connections and hand one off to each component as needed.
Most modern application servers also support some form of load balancing. This allows
multiple instances of an application server to run, possibly on different computers. If one
application server gets too busy or one of the computers crashes, all requests can go to
another server. The users should never even notice the problem.
HTML from program logic. The motivation behind many of these approaches can be
understood by first considering a very simple CGI and building the complexity up from
there.
Consider again
bunch of HTML. Therefore, all the HTML could be pulled out of the CGI and put into a
separate file. The CGI would open this file, read the contents, and send them back to the
server. The HTML author could then edit the file without needing to touch the program
code.
Once this mechanism has been built, it is easy to extend it slowly in order to include such
things as the date and time. This is a specific instance of a general problem, namely, that
frequently a CGI will have to incorporate some data, such as the date or a user's name,
into the page.
However, the HTML author need not care where this data comes from. As far as the
design of the page is concerned, the important thing is that the date shows up where it
belongs. The HTML author could indicate this by using a special tag, perhaps something
like