Servlets and Session Management

Earlier I suggested that servlets are best used as interactive session managers. To understand this a little better, we need to discuss session management in more detail.

Simply put, session management is the idea of associating a series of activities with a distinct end user. For example, if we're deploying an online bookstore, a session might be composed of the following activities:

  1. User logs in.

  2. User searches for mystery books.

  3. User investigates a new book by Philip Margolin.

  4. User purchases the book.

  5. User searches for new Java books.

  6. User logs out.

Thus, a session is a series of activities that may contain zero or more transactions or, more to the point, a session is the logical use of an application by a client. ...

Get Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology 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.