The Advantages of Servlets
Over Traditional CGI
Efficient
Threads instead of OS processes, one servlet copy,
persistence
Convenient
Lots of high level utilities
Powerful
Sharing data, pooling, persistence
Portable
Run on virtually all operating systems and servers
Secure
No shell escapes, no buffer overflows
Inexpensive
5
Servlets
www.corewebprogramming.com
Why Build Pages Dynamically?
The Web page is based on data submitted
by the user
E.g., results page from search engines and order
confirmation pages at on line stores
The Web page is derived from data that
changes frequently
E.g., a weather report or news headlines page
The Web page uses information from
databases or other server side sources
E.g., an e commerce site could use a servlet to build a
Web page that lists the current price and availability of
each item that is for sale
6
Servlets
www.corewebprogramming.com
3