Chapter 11. Servlets

This book has made many references to servlets. In particular, it has been repeatedly noted that a JSP file is turned into a servlet at translation time and that the resulting servlet is run at request time. This means that JSPs and servlets are the same thing.

As discussed in Chapter 1, a servlet is a small class that may be thought of as a dynamic extension to a Web server or application server. CGIs, by contrast, are external programs started by the Web server. This change from external to internal extensions has a number of advantages, chief of which is performance. Because a servlet is loaded only once, the first time it is needed and subsequently, it resides in the same Java virtual machine (JVM) as the Web server or ...

Get JavaServer Pages™, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.