O'Reilly logo

Special Edition Using Java™ Server Pages and Servlets by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. JSP and Servlet Lifecycles

In this chapter

Now that you understand the major features of JSP and servlets, it's time to drill down into some of the underlying structure. It is important to understand the JSP and servlet lifecycle: when and how servlets and JSPs are loaded, executed, and unloaded. Because Java Server Pages are also servlets, it makes sense to start with servlets.

Servlet Lifecycle

A servlet goes through four phases:

  • Loading

  • Initialization

  • Execution

  • Cleanup

Servlet Loading

A servlet can be loaded at three different times: when the server starts up, when the system administrator asks the server to load the servlet, or when a browser tries to access the servlet. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required