CISC474, Reading Notes for Sebesta,
Programming The World Wide Web, 3rd Edition

Reading notes by Phill Conrad, Asst. Professor, CIS Dept. University of Delaware


Chapter 11: Servlets and Java Server Pages

@@@

11.1 Overview of Servlets

@@@

11.2 Servlet Details

@@@

11.3 A Survey Example

@@@

11.4 Storing Information on Clients

@@@

11.4.1 Cookies

@@@Text for subsection@@@

11.4.2 Session Tracking

@@@Text for subsection@@@

11.5 Java Server Pages

@@@

11.5.1 Motivations for JSP

@@@Text for subsection@@@

11.5.2 JSP Documents

@@@Text for subsection@@@

11.5.3 Scriptlets

@@@Text for subsection@@@

11.5.4 Expression Language

@@@Text for subsection@@@

11.5.5 JSTL Control Action Elements

@@@Text for subsection@@@

11.6 Summary

@@@

11.7 Review Questions

@@@

Ryan Whited from the 06S CISC474 class wrote the following:

After reading through Sebesta's and other internet sources about the advantages of servlets over CGI programs, this is what I have found.

Efficiency: A servlet lives within the Java virtual machine which runs constantly handling requests within separate threads. This is a better way of handling requests then a CGI program because each time the CGI program is requested, a new instance of that program is loaded into memory. On the other hand, only one instance of the servlet lives within the Java virtual machine and each request gets its own unique thread to make calls to the servlet. This is a much more efficient way of handling requests and is less memory intensive.

Security: The security of a servlet is handled by the Java virtual machine. This "sandbox" that the servlets live in help security factors that might be overlooked by traditional CGI programs. One example of this is buffer overflows. Since bounds checking is not automatically done in CGIs, the task is left to the programmer. Everyone knows that leaving tasks up to the programmer is leaving a door wide open for mistakes. Bounds checking and other memory protection features are built into the Java language.

Infrastructure: Servlets are convenient in the fact that they have many built-in features that are not available with CGIs. Parsing and decoding HTML form data, cookies, tracking sessions, and a list of other utilities are built-in and easy to use. These amenities show that servlets have many advantages over CGI programs for server-side programming.

What can you add to this discussion? How do the advantages of Servlets over CGI stack up when we add ASP.NET, PHP, Cold Fusion, and other web app platforms into the mix? Post your thoughts on the discussion board on WebCT.

11.8 Exercises

@@@


Valid XHTML 1.1 Valid CSS!