The Servlet Life Cycle


Overview

In the previous chapter, we introduced the process of building dynamic Web pages using JSP pages. JSP pages allow you to mix Java code with HTML in a single file. While the JSP paradigm is powerful, you want to completely remove the Java code used for the business rules and database access from the presentation. The JSP page does a good job, but an even better way is through the use of servlets.

A servlet is a class designed to extend the server on which it executes. The servlet typically responds to HTTP requests, specifically GET and POST. Java's servlet support is found in two packages: javax.servlet and javax.servlet.http. Over the past few years, servlets have evolved into a Web service since they can be designed to handle requests from both a Web browser and another application.

In this chapter, we look at how servlets work and examine Resin's support of servlets. We also provide several examples to get you on your way to writing them yourself.




Mastering Resin
Mastering Resin
ISBN: 0471431036
EAN: 2147483647
Year: 2002
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net